回覆列表
  • 1 # 使用者5295278951632

    select bg_severity,count(*) as row_count

    from 表名 group by bg_severity

    結果:

    bg_severity row_count

    1-低 xx

    2-中 xx

    1-高 xx

    select sum(case when bg_severity = N"1-低" then 1 else 0 end) as [1-低],

    sum(case when bg_severity = N"2-中" then 1 else 0 end) as [2-中],

    sum(case when bg_severity = N"3-高" then 1 else 0 end) as [3-高]

    from 表名

    結果:

    1-低 |2-中 |3-高

    xx |xx | xx

  • 中秋節和大豐收的關聯?
  • 財達證券交易系統如何下載?