예를들어
select
m.idx ,
(select aa from AA where idx=m.idx) as nc ,
(select bb from BB where idx=m.idx) as nc2 ,
(nc+nc2) as nc_total
from Maintable as m where nc < 10
이렇게 짰을때
(nc+nc2) as nc_total 이 부분과
nc < 10 부분이 unknown 칼럼오류가 발생합니다...
컨트롤 할수 있는 방법이 없을까요?
고수님들의 주옥같은 댓글 부탁드립니다..
Comment 2
-
이리
2016.09.01 11:24
selectm.idx ,(select aa from AA where idx=m.idx) as nc ,(select bb from BB where idx=m.idx) as nc2 ,((select aa from AA where idx=m.idx)+(select bb from BB where idx=m.idx)) as nc_totalfrom Maintable as m where (select aa from AA where idx=m.idx) < 10SELECT m.idx, m.nc, m.nc2, (m.nc+m.nc2) as nc_totalFROM(selectm.idx ,(select aa from AA where idx=m.idx) as nc,(select bb from BB where idx=m.idx) as nc2from Maintable as m) AS mwhere m.nc < 10 -
질문쟁이
2016.09.01 11:32
감사합니다!!! ^^