当前位置:Gxlcms > 数据库问题 > oracle按照指定列分组合计group by rollup()

oracle按照指定列分组合计group by rollup()

时间:2021-07-01 10:21:17 帮助过:258人阅读

group by rollup() 按分组合计

select grouping(status),status,owner,object_type,count(*) from dba_objects

where owner not in (‘SYS‘,‘SYSTEM‘)

group by rollup (status,owner,object_type)

order by status,owner,object_type;

经典分类查询语句:

select object_type,count(*) from

( select decode(object_type,‘TABLE‘,‘TABLE‘,‘INDEX‘,‘INDEX‘,‘OTHERS‘) object_type from dba_objects )

group by rollup(object_type);

oracle按照指定列分组合计group by rollup()

标签:stat   code   decode   class   组合   group   查询语句   分类   Owner   

人气教程排行