时间:2021-07-01 10:21:17 帮助过:25人阅读
-- oracle、mysql通用 select case when t2.id = ‘0‘ then ‘合计‘ else t2.id end id, sum(count) count from test1 t1,test2 t2 where t1.id = t2.name group by t2.id;
-- mysql select case when id is null then ‘合计‘ else id end id, sum(count) from test1 GROUP BY id with ROLLUP; -- oracle select id,sum(count) from test1 group by rollup(id);
sql求合计值(rollup函数应用)
标签:color charset har acl 技术 rollup mysq sele 通用