with.... as... 관련 질문입니다... 0 1 1,706

by 별이... [SQLServer] [2010.06.09 09:19:50]


with
tempTable1 as (
select '1' col union all
select '2' col union all
select '3' col union all
select '4' col union all
select '5' col ),
tempTable2 as (
select col
from hintTable -- hintTable (컬럼종류는 col, col2... 있다고 가정)
where ...)
select *
from tempTable1 a,
   tempTable2 b
where a.col = b.col

-> 이런형식으로 쿼리 작성중인데 mssql2000 에서는 with... as... 구문이 안먹히는것 같습니다...
    마땅한 다른 방법이 떠오르지 않아서 부득이하게 질문란에 올리게 되었습니다...
    답변 부탁드립니다... -- __ -- 꾸벅~
by 이재현 [2010.06.09 09:27:33]
MSSQL2005 는 먹히는 데.. 2000은 안먹히나보군요

인라인뷰 형식으로 쓰심되어요..


대충 이런식..

SELECT *
FROM hintTable a
, (select '1' col union all
select '2' col union all
select '3' col union all
select '4' col union all
select '5' col )B
WHERE A.COL = B.COL
AND .....
댓글등록
SQL문을 포맷에 맞게(깔끔하게) 등록하려면 code() 버튼을 클릭하여 작성 하시면 됩니다.
로그인 사용자만 댓글을 작성 할 수 있습니다. 로그인, 회원가입