sql优化
关于分组统计selectsum(case when salary>9999 and age>35 then 1 else 0 end) AS ‘第一组’ ,sum(case when salary>9999 and age<35 then 1 else 0 end) AS ‘第二组’ ,sum(case when salary<9999 and age>35 then 1 else 0 end) AS ‘第三组’ from db_job.tb_emp ;
原创
2020-05-31 17:03:24 ·
178 阅读 ·
0 评论