SQL 统计一个列中的三种值的数量,并在一个表中显示

日期:2018-05-08 11:30:11 人气:1

SQL 统计一个列中的三种值的数量,并在一个表中显示

select sum(case when status='child' then 1 else 0 end) as 'child 数量' ,sum(case when status='young' then 1 else 0 end) as 'young 数量' ,sum(case when status='old' then 1 else 0 end) as 'old 数量'from
    A+
热门评论