sql 列转行

    技术2022-06-08  37

     

    代码

     

    select name as '姓名', sum(case kemu when '语文' then store end ) as '语文', sum(case kemu when '数学' then store end ) as '数学', sum(case kemu when '英语' then store end ) as '英语', sum(case kemu when '政治' then store end ) as '政治' from storeinfo group by name

     

    效果如下:

     

     


    最新回复(0)