34,590
社区成员
发帖
与我相关
我的任务
分享
WITH tmp (xxx, xxx, ...) AS (
SELECT ... FROM ...
)
SELECT * FROM tmp;
create table #temp
(
id int,
name varchar(20)
)
insert into #temp values (1,'AAA')
insert into #temp values (1,'BBB')
insert into #temp values (1,'CCC')
with cte
as
(
select id ,name from #temp
)
select * from cte
id name
----------- --------------------
1 AAA
1 BBB
1 CCC
(3 行受影响)