sql创建临时表并且插入数据

复制代码
if OBJECT_ID('tempdb..#temp') is not null
drop table #temp
select * into #temp from 
(
  --select * from Activity
    select 7 as 'month',25 as 'day'
    union all
    select 7 as 'month',25 as 'day'
    union all
    select 8 as 'month',25 as 'day' 
    union all
    select 8 as 'month',25 as 'day'
    union all
    select 8 as 'month',25 as 'day'
 
) as A


select *  from #temp
复制代码

 

posted @   沉迷编程的程序员  阅读(2880)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示