展开全部
select t.* from
(select kh,'01' as kmdm,[01] as cj from 表名
union all
select kh,'02' as kmdm,[02] as cj from 表名
union all
select kh,'03' as kmdm,[03] as cj from 表名
union all
select kh,'04' as kmdm,[04] as cj from 表名
union all
select kh,'05' as kmdm,[05] as cj from 表名
union all
select kh,'06' as kmdm,[06] as cj from 表名
union all
select kh,'07' as kmdm,[07] as cj from 表名
union all
select kh,'08' as kmdm,[08] as cj from 表名
union all
select kh,'09' as kmdm,[09] as cj from 表名
union all
select kh,'10' as kmdm,[10] as cj from 表名
union all
select kh,'11' as kmdm,[11] as cj from 表名) as t
order by t.kh,t.kmdm
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询