union组合结果集
--相同合并 select 'a',1 union select 'a',1 --全部显示 select 'a',1 union all select 'a',1
公用表表达式
with CET( wName,dName) as ( select wName,dName from dbo.Worker inner join dbo.DepartMent on Worker.did = DepartMent.dID ) select * from CET
将结果集保存到表中
select wName,dName into CCC from dbo.Worker inner join dbo.DepartMent on Worker.did = DepartMent.dID