create view v_s
as
select f_xm,f_bm,c1 as c from webkqdj
union all
select f_xm,f_bm,c2 as c from webkqdj
union all
select f_xm,f_bm,c3 as c from webkqdj
union all
select f_xm,f_bm,c4 as c from webkqdj
union all
select f_xm,f_bm,c5 as c from webkqdj
union all
select f_xm,f_bm,c6 as c from webkqdj
union all
select f_xm,f_bm,c7 as c from webkqdj
union all
select f_xm,f_bm,c8 as c from webkqdj
union all
select f_xm,f_bm,c9 as c from webkqdj
union all
select f_xm,f_bm,c10 as c from webkqdj
union all
select f_xm,f_bm,c11 as c from webkqdj
union all
select f_xm,f_bm,c12 as c from webkqdj
union all
select f_xm,f_bm,c13 as c from webkqdj
union all
select f_xm,f_bm,c14 as c from webkqdj
union all
select f_xm,f_bm,c15 as c from webkqdj
union all
select f_xm,f_bm,c16 as c from webkqdj
union all
select f_xm,f_bm,c17 as c from webkqdj
union all
select f_xm,f_bm,c18 as c from webkqdj
union all
select f_xm,f_bm,c19 as c from webkqdj
union all
select f_xm,f_bm,c20 as c from webkqdj
union all
select f_xm,f_bm,c21 as c from webkqdj
union all
select f_xm,f_bm,c22 as c from webkqdj
union all
select f_xm,f_bm,c23 as c from webkqdj
union all
select f_xm,f_bm,c24 as c from webkqdj
union all
select f_xm,f_bm,c25 as c from webkqdj
union all
select f_xm,f_bm,c26 as c from webkqdj
union all
select f_xm,f_bm,c27 as c from webkqdj
union all
select f_xm,f_bm,c28 as c from webkqdj
union all
select f_xm,f_bm,c29 as c from webkqdj
union all
select f_xm,f_bm,c30 as c from webkqdj
union all
select f_xm,f_bm,c31 as c from webkqdjgo各位大侠,帮帮忙
as
select f_xm,f_bm,c1 as c from webkqdj
union all
select f_xm,f_bm,c2 as c from webkqdj
union all
select f_xm,f_bm,c3 as c from webkqdj
union all
select f_xm,f_bm,c4 as c from webkqdj
union all
select f_xm,f_bm,c5 as c from webkqdj
union all
select f_xm,f_bm,c6 as c from webkqdj
union all
select f_xm,f_bm,c7 as c from webkqdj
union all
select f_xm,f_bm,c8 as c from webkqdj
union all
select f_xm,f_bm,c9 as c from webkqdj
union all
select f_xm,f_bm,c10 as c from webkqdj
union all
select f_xm,f_bm,c11 as c from webkqdj
union all
select f_xm,f_bm,c12 as c from webkqdj
union all
select f_xm,f_bm,c13 as c from webkqdj
union all
select f_xm,f_bm,c14 as c from webkqdj
union all
select f_xm,f_bm,c15 as c from webkqdj
union all
select f_xm,f_bm,c16 as c from webkqdj
union all
select f_xm,f_bm,c17 as c from webkqdj
union all
select f_xm,f_bm,c18 as c from webkqdj
union all
select f_xm,f_bm,c19 as c from webkqdj
union all
select f_xm,f_bm,c20 as c from webkqdj
union all
select f_xm,f_bm,c21 as c from webkqdj
union all
select f_xm,f_bm,c22 as c from webkqdj
union all
select f_xm,f_bm,c23 as c from webkqdj
union all
select f_xm,f_bm,c24 as c from webkqdj
union all
select f_xm,f_bm,c25 as c from webkqdj
union all
select f_xm,f_bm,c26 as c from webkqdj
union all
select f_xm,f_bm,c27 as c from webkqdj
union all
select f_xm,f_bm,c28 as c from webkqdj
union all
select f_xm,f_bm,c29 as c from webkqdj
union all
select f_xm,f_bm,c30 as c from webkqdj
union all
select f_xm,f_bm,c31 as c from webkqdjgo各位大侠,帮帮忙
select f_xm,f_bm,c1 as c from webkqdj insert into T
select f_xm,f_bm,c2 as c from webkqdj
...................一次c3c31//应用 T
//删除T
select * into # from (
select f_xm,f_bm,c1 as c from webkqdj
union all
select f_xm,f_bm,c2 as c from webkqdj
union all
select f_xm,f_bm,c3 as c from webkqdj
union all
select f_xm,f_bm,c4 as c from webkqdj
union all
select f_xm,f_bm,c5 as c from webkqdj
union all
select f_xm,f_bm,c6 as c from webkqdj
union all
select f_xm,f_bm,c7 as c from webkqdj
union all
select f_xm,f_bm,c8 as c from webkqdj
union all
select f_xm,f_bm,c9 as c from webkqdj
union all
select f_xm,f_bm,c10 as c from webkqdj
union all
select f_xm,f_bm,c11 as c from webkqdj
union all
select f_xm,f_bm,c12 as c from webkqdj
union all
select f_xm,f_bm,c13 as c from webkqdj
union all
select f_xm,f_bm,c14 as c from webkqdj
union all
select f_xm,f_bm,c15 as c from webkqdj
union all
select f_xm,f_bm,c16 as c from webkqdj
union all
select f_xm,f_bm,c17 as c from webkqdj
union all
select f_xm,f_bm,c18 as c from webkqdj
union all
select f_xm,f_bm,c19 as c from webkqdj
union all
select f_xm,f_bm,c20 as c from webkqdj
union all
select f_xm,f_bm,c21 as c from webkqdj
union all
select f_xm,f_bm,c22 as c from webkqdj
union all
select f_xm,f_bm,c23 as c from webkqdj
union all
select f_xm,f_bm,c24 as c from webkqdj
union all
select f_xm,f_bm,c25 as c from webkqdj
union all
select f_xm,f_bm,c26 as c from webkqdj
union all
select f_xm,f_bm,c27 as c from webkqdj
union all
select f_xm,f_bm,c28 as c from webkqdj
union all
select f_xm,f_bm,c29 as c from webkqdj
union all
select f_xm,f_bm,c30 as c from webkqdj
union all
select f_xm,f_bm,c31 as c from webkqdj ) t
(
select f_xm,f_bm,c1 as c from webkqdj
union all
select f_xm,f_bm,c2 as c from webkqdj
union all
select f_xm,f_bm,c3 as c from webkqdj
union all
select f_xm,f_bm,c4 as c from webkqdj
union all
select f_xm,f_bm,c5 as c from webkqdj
union all
select f_xm,f_bm,c6 as c from webkqdj
union all
select f_xm,f_bm,c7 as c from webkqdj
union all
select f_xm,f_bm,c8 as c from webkqdj
union all
select f_xm,f_bm,c9 as c from webkqdj
union all
select f_xm,f_bm,c10 as c from webkqdj
union all
select f_xm,f_bm,c11 as c from webkqdj
union all
select f_xm,f_bm,c12 as c from webkqdj
union all
select f_xm,f_bm,c13 as c from webkqdj
union all
select f_xm,f_bm,c14 as c from webkqdj
union all
select f_xm,f_bm,c15 as c from webkqdj
union all
select f_xm,f_bm,c16 as c from webkqdj
union all
select f_xm,f_bm,c17 as c from webkqdj
union all
select f_xm,f_bm,c18 as c from webkqdj
union all
select f_xm,f_bm,c19 as c from webkqdj
union all
select f_xm,f_bm,c20 as c from webkqdj
union all
select f_xm,f_bm,c21 as c from webkqdj
union all
select f_xm,f_bm,c22 as c from webkqdj
union all
select f_xm,f_bm,c23 as c from webkqdj
union all
select f_xm,f_bm,c24 as c from webkqdj
union all
select f_xm,f_bm,c25 as c from webkqdj
union all
select f_xm,f_bm,c26 as c from webkqdj
union all
select f_xm,f_bm,c27 as c from webkqdj
union all
select f_xm,f_bm,c28 as c from webkqdj
union all
select f_xm,f_bm,c29 as c from webkqdj
union all
select f_xm,f_bm,c30 as c from webkqdj
union all
select f_xm,f_bm,c31 as c from webkqdj
) T
select f_xm,f_bm,c1 as c from webkqdj
union all
select f_xm,f_bm,c2 as c from webkqdj
union all
select f_xm,f_bm,c3 as c from webkqdj
union all
select f_xm,f_bm,c4 as c from webkqdj
union all
select f_xm,f_bm,c5 as c from webkqdj
union all
select f_xm,f_bm,c6 as c from webkqdj
union all
select f_xm,f_bm,c7 as c from webkqdj
union all
select f_xm,f_bm,c8 as c from webkqdj
union all
select f_xm,f_bm,c9 as c from webkqdj
union all
select f_xm,f_bm,c10 as c from webkqdj
union all
select f_xm,f_bm,c11 as c from webkqdj
union all
select f_xm,f_bm,c12 as c from webkqdj
union all
select f_xm,f_bm,c13 as c from webkqdj
union all
select f_xm,f_bm,c14 as c from webkqdj
union all
select f_xm,f_bm,c15 as c from webkqdj
union all
select f_xm,f_bm,c16 as c from webkqdj
union all
select f_xm,f_bm,c17 as c from webkqdj
union all
select f_xm,f_bm,c18 as c from webkqdj
union all
select f_xm,f_bm,c19 as c from webkqdj
union all
select f_xm,f_bm,c20 as c from webkqdj
union all
select f_xm,f_bm,c21 as c from webkqdj
union all
select f_xm,f_bm,c22 as c from webkqdj
union all
select f_xm,f_bm,c23 as c from webkqdj
union all
select f_xm,f_bm,c24 as c from webkqdj
union all
select f_xm,f_bm,c25 as c from webkqdj
union all
select f_xm,f_bm,c26 as c from webkqdj
union all
select f_xm,f_bm,c27 as c from webkqdj
union all
select f_xm,f_bm,c28 as c from webkqdj
union all
select f_xm,f_bm,c29 as c from webkqdj
union all
select f_xm,f_bm,c30 as c from webkqdj
union all
select f_xm,f_bm,c31 as c from webkqdj
)T
go
SELECT * INTO # FROM view v_s
declare @sql varchar(8000)
set @sql=''select
@sql=@sql+' union all select f_xm,f_bm,'+name+' as c from webkqdj '
from
syscolumns
where
id=object_id('webkqdj')
and
name like 'c%'set @sql='create view v_s as '+ stuff(@sql,1,11,'')exec(@sql)
from webkqdj
union all
select f_xm,f_bm,c2 as c from webkqdj
union all
select f_xm,f_bm,c3 as c from webkqdj
union all
select f_xm,f_bm,c4 as c from webkqdj
union all
select f_xm,f_bm,c5 as c from webkqdj
union all
select f_xm,f_bm,c6 as c from webkqdj
union all
select f_xm,f_bm,c7 as c from webkqdj
union all
select f_xm,f_bm,c8 as c from webkqdj
union all
select f_xm,f_bm,c9 as c from webkqdj
union all
select f_xm,f_bm,c10 as c from webkqdj
union all
select f_xm,f_bm,c11 as c from webkqdj
union all
select f_xm,f_bm,c12 as c from webkqdj
union all
select f_xm,f_bm,c13 as c from webkqdj
union all
select f_xm,f_bm,c14 as c from webkqdj
union all
select f_xm,f_bm,c15 as c from webkqdj
union all
select f_xm,f_bm,c16 as c from webkqdj
union all
select f_xm,f_bm,c17 as c from webkqdj
union all
select f_xm,f_bm,c18 as c from webkqdj
union all
select f_xm,f_bm,c19 as c from webkqdj
union all
select f_xm,f_bm,c20 as c from webkqdj
union all
select f_xm,f_bm,c21 as c from webkqdj
union all
select f_xm,f_bm,c22 as c from webkqdj
union all
select f_xm,f_bm,c23 as c from webkqdj
union all
select f_xm,f_bm,c24 as c from webkqdj
union all
select f_xm,f_bm,c25 as c from webkqdj
union all
select f_xm,f_bm,c26 as c from webkqdj
union all
select f_xm,f_bm,c27 as c from webkqdj
union all
select f_xm,f_bm,c28 as c from webkqdj
union all
select f_xm,f_bm,c29 as c from webkqdj
union all
select f_xm,f_bm,c30 as c from webkqdj
union all
select f_xm,f_bm,c31 as c from webkqdj