我可以做
select * into #randomTenUsers from
(select top 10 * from users)x
select * from #randomTenUsers
或者
WITH randomTenUsers as (select top 10 * from users)
select * from randomTenUsers
据我了解, WITH 语句也会创建一个临时结果集。
有没有理由为什么应该优先使用 WITH 而不是临时表,反之亦然?