sqlserver将一行数据转为一列显示,怎么实现

日期:2017-12-15 13:44:50 人气:2

sqlserver将一行数据转为一列显示,怎么实现

select * from ( select id as Name , Subject = 'id' , Result = id from tb1 union all select id as Name , Subject = 'yytc' , Result = yytcfrom tb1 ) t order by name , case Subject when 'id' then 1 when 'yytc' the
    A+
热门评论