database.sarang.net
UserID
Passwd
Database
DBMS
MySQL
PostgreSQL
Firebird
Oracle
Informix
Sybase
ㆍMS-SQL
DB2
Cache
CUBRID
LDAP
ALTIBASE
Tibero
DB 문서들
스터디
Community
공지사항
자유게시판
구인|구직
DSN 갤러리
도움주신분들
Admin
운영게시판
최근게시물
MS-SQL Q&A 3630 게시물 읽기
No. 3630
union all 에러
작성자
손님
작성일
2007-07-11 21:58
조회수
2,242


아래 쿼리중에서 

아래부분을 뺴면 이상없는데 

아래 부분을 감싸면 

')' 근처의 구문이 잘못되었습니다.

라고 에러가 나는데 왜그러죠>??

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') 

)

이 글에 대한 댓글이 총 1건 있습니다.

select * from (


.......

) as ttt 이런식으로 alias명을 줘 보세요....

지나가다가님이 2007-07-12 00:47에 작성한 댓글입니다. Edit
[Top]
No.
제목
작성자
작성일
조회
3633오라클의 rowtype 이 ms-sql (8) 없나요??? [1]
co
2007-07-13
3074
3632app내에서 3만건정도의 업뎃문을 1회 sqlexec로 실행합니다...
김승일
2007-07-13
2181
3631connection 문제
조승우
2007-07-11
2410
3630union all 에러 [1]
손님
2007-07-11
2242
3629정렬문제인데 미치겠습니다.
궁금
2007-07-11
2333
3628EM환경에서 쿼리가 훨씬 빨라요!!
김승일
2007-07-11
2121
3627시스템을 구축하려는데 어떻게 하면 될까요
조광수
2007-07-11
1883
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2024 DSN, All rights reserved.
작업시간: 0.023초, 이곳 서비스는
	PostgreSQL v16.4로 자료를 관리합니다