답변:
CTE가 시야에 들어갑니다.
CTE로 문의하십시오
WITH cte AS (...) SELECT ...;
CREATE VIEW AS를 추가하십시오 .. GO
CREATE VIEW
AS
WITH cte AS (...) SELECT ...;
GO
MSDN은 여러 CTE를 설명합니다 (예 j 참조).
CREATE VIEW
AS
WITH
cte1 AS (...),
cte2 AS (...),
cte3 AS (...)
SELECT ...
GO
CREATE VIEW
someview
AS
WITH CTEstuff AS (SELECT etc)
SELECT * FROM CTESTuff;
create view myView as ( select ... )
작동create view myView as with tempTbl as select ...
하지만create view myView as ( with tempTbl as select ... )
구문 오류입니다. `