求一存储过程的SQL语句!
a表有10个字段,分别为a01,a02……a10
我想使用一条sql语句将此十个字段的数据作为10条记录写入临时表里,如何写?
推荐阅读
select a01 into #tmp from a表
union all
select a02 from a表
union all
select a03 from a表
...
union all
select a10 from a表
select a01 into #tmp from a表
union all
select a02 from a表
union all
select a03 from a表
...
union all
select a10 from a表
select a1 into #temptable from a
union all
select a2 from a
.....
union
select a10 from a
select a01 into #temp from a表
union all
select a02 from a表
union all
select a03 from a表
...
union all
select a10 from a表


讨论区