bug_x

导航

 
select coalesce(t.name,'总'),sum(t.v) from (select '小丽' as name,1 as v UNION ALL select '小丽' as name,2 as v ) t group by t.name with ROLLUP

  

with ROLLUP  结合 coalesce() 自动汇总.

 

posted on 2021-09-09 15:15  bug_x  阅读(63)  评论(0编辑  收藏  举报