weixin_42487393
Amnesiai
2019-07-24 09:07
采纳率: 50%
浏览 377

SQL语句把行转换为列,表1转为表2

请问怎么将表1转换为表2哇,用SQL语句

图片说明

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

3条回答 默认 最新

  • caozhy
    已采纳

    (select "一季度" as 季度, 一季度 as 值 from table) union
    (select "二季度" as 季度, 二季度 as 值 from table) union
    (select "三季度" as 季度, 三季度 as 值 from table) union
    (select "四季度" as 季度, 四季度 as 值 from table)

    点赞 评论
  • dianhuilu4947
    叶子兔 2019-07-24 09:26
    点赞 评论
  • l_w610
    l_w610 2019-07-24 10:31

    PIVOT 了解一下.........

    点赞 评论

相关推荐