使用:
SELECt pvt.Name , isnull(pvt.[vocals], '') [vocals] , isnull(pvt.[guitar], '') [guitar] , isnull(pvt.[bass], '') [bass] , isnull(pvt.[drums], '') [drums]FROM PivotSource PIVOT( max(tool) FOR tool IN ([vocals], [guitar], [bass], [drums]) ) pvt;
输出:
Name vocals guitar bass drums---------- ---------- ---------- ---------- ----------george vocals john vocals guitar paul vocals bass ringo vocals drumsroyi vocals guitar yoko vocals
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)