아래 쿼리중에서
아래부분을 뺴면 이상없는데
아래 부분을 감싸면
')' 근처의 구문이 잘못되었습니다.
라고 에러가 나는데 왜그러죠>??
select * from (
.......
)
select * from (
select b.i_usr ,
a.i_company ,
a.i_telnum ,
a.d_retire ,
a.N_usr_dom ,
(select N_code_dom from mst_0020 where i_code_grp ='005' and a.i_yn = i_code) as i_yn,
b.i_authority as i_authority
from MST_0110 a, smt_0050 b
where a.i_usr = b.i_usr and
b.i_system ='taisungscm' and
b.i_menu ='001'
union all
select
a.i_usr ,
a.i_company ,
a.i_telnum ,
a.d_retire ,
a.N_usr_dom ,
(select N_code_dom from mst_0020 where i_code_grp ='005' and a.i_yn = i_code) as i_yn,
(select i_authority from SMT_0040 where i_system ='taisungscm' and i_menu ='001' and i_role ='3') as i_authority
from MST_0110 a
where not exists (select i_usr from smt_0050 where a.i_usr = i_usr) and
a.i_usr in
(select i_usr from MST_0110 where i_role <= '3')
)
|