话不多说,请看代码:
declare @tb table ( cid int ,cname varchar(10) ) insert into @tb select 1,'aa' union all select 2,'bb' select * from @tb declare @idaa int ,@idbb int select aa,bb from( select cid,cname from @tb )as tt pivot( max(cid) for cname in([aa],bb) )piv
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,同时也希望多多支持考高分网!



