create table a (wlbh varchar(10) null, wlmc varchar(20) null,zsl float null,yql float null,eql float null,sql float null,siql float null)
go
insert into a values('11-223', '我爱你' , 500 , 100 , 200 , 100 , 100)
insert into a values('22-228' , '你爱他', 800 , 200 , 200 ,200 , 200)
go
create table b(bh int null,wlmc varchar(20) null,sl float null)
go
insert into b
select 0,wlmc,zsl
from a
union
all
select 1,wlmc,yql
from a
union
all
select 2,wlmc,eql
from a
union
all
select 3,wlmc,sql
from a
union
all
select 4,wlmc,siql
from a
goselect * from b order by wlmc desc,bh
go
insert into a values('11-223', '我爱你' , 500 , 100 , 200 , 100 , 100)
insert into a values('22-228' , '你爱他', 800 , 200 , 200 ,200 , 200)
go
create table b(bh int null,wlmc varchar(20) null,sl float null)
go
insert into b
select 0,wlmc,zsl
from a
union
all
select 1,wlmc,yql
from a
union
all
select 2,wlmc,eql
from a
union
all
select 3,wlmc,sql
from a
union
all
select 4,wlmc,siql
from a
goselect * from b order by wlmc desc,bh
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货