Wednesday, December 3, 2014

UNION between two CTE result set

That's not the syntax for CTEs..



;WITH cte1 AS (
SELECT 'a' as a, 'b' as b
), cte2 AS (
SELECT 'c' as a, 'd' as b
)

SELECT *
FROM cte1
UNION ALL
SELECT *
FROM cte2


No comments:

Post a Comment