开发者

Where is the spec for "grand total" in oracles group by grouping sets?

开发者 https://www.devze.com 2023-04-12 13:09 出处:网络
This is a valid sql statment for oracle 11 sql: select LASTNAME, SUM(ID) from PERSON group by grouping sets ((LASTNAME), ())

This is a valid sql statment for oracle 11 sql:

select LASTNAME, SUM(ID) from PERSON group by grouping sets ((LASTNAME), ())

But I can not find the specification for the grand total "()" in the Oracle® Database SQL Language Reference. Can someone please show me where I开发者_StackOverflow can find the specification for this?


You mean this?


Why not just:

select lastname, sum(id)
from person
group by rollup(lastname);

This should give you the total you seek.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号