SELECT c.job_nm,
m1.major_desc major_desc_1,
m2.major_desc major_desc_2,
m3.major_desc major_desc_3,
m4.major_desc major_desc_4,
m5.major_desc major_desc_5
FROM
job_education e ,
job_class c
LEFT OUTER JOIN JOB_MAJOR m1 ON e.edu_cd1 = m1.MAJOR_CD
LEFT OUTER JOIN JOB_MAJOR m2 ON e.edu_cd2 = m2.MAJOR_CD
LEFT OUTER JOIN JOB_MAJOR m3 ON e.edu_cd3 = m3.MAJOR_CD
LEFT OUTER JOIN JOB_MAJOR m4 ON e.edu_cd4 = m4.MAJOR_CD
LEFT OUTER JOIN JOB_MAJOR m5 ON e.edu_cd5 = m5.MAJOR_CD
WHERE
c.JOB_CD = e.JOB_CD
AND
c.JOB_DEPTH =3
==> 위의 쿼리를 실행하면
"여러 부분으로 구성된 식별자 " e.edu_cd1"은 바인딩할수 없습니다. serverity 16 " 에러가 발생된다.
해결방법.
아래와 같이 from 절의 테이블 순서를 변경해주면된다.
FROM
job_education e
LEFT OUTER JOIN JOB_MAJOR m1 ON e.edu_cd1 = m1.MAJOR_CD
LEFT OUTER JOIN JOB_MAJOR m2 ON e.edu_cd2 = m2.MAJOR_CD
LEFT OUTER JOIN JOB_MAJOR m3 ON e.edu_cd3 = m3.MAJOR_CD
LEFT OUTER JOIN JOB_MAJOR m4 ON e.edu_cd4 = m4.MAJOR_CD
LEFT OUTER JOIN JOB_MAJOR m5 ON e.edu_cd5 = m5.MAJOR_CD
,job_class c
혹은
FROM
job_class c,
job_education e
LEFT OUTER JOIN JOB_MAJOR m1 ON e.edu_cd1 = m1.MAJOR_CD
LEFT OUTER JOIN JOB_MAJOR m2 ON e.edu_cd2 = m2.MAJOR_CD
LEFT OUTER JOIN JOB_MAJOR m3 ON e.edu_cd3 = m3.MAJOR_CD
LEFT OUTER JOIN JOB_MAJOR m4 ON e.edu_cd4 = m4.MAJOR_CD
LEFT OUTER JOIN JOB_MAJOR m5 ON e.edu_cd5 = m5.MAJOR_CD
이렇게 순서를 바꾸어주면 job_class 컬럼명을 select 어느 위치에 와도 문제가 없다.
'Programming > DataBase' 카테고리의 다른 글
[MSSQL] Cannot insert explicit value for identity column in table (0) | 2013.02.26 |
---|---|
[MsSql] 문자-날짜-형변환 쿼리 (0) | 2013.01.30 |
[oracle] 계층 쿼리시 계층별로 정렬하기 위해.. order siblings by (0) | 2012.11.20 |
[oracle]START WITH ... CONNECT BY 절을 사용한 계층형쿼리 (0) | 2012.11.20 |
[oracle] function (0) | 2012.11.09 |