Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Trouble with Rollup and Grouping

136578Dec 13 2001
hi,
i am using oracle 8.1.6 and have a question concerning ROLLUP and GROUPING-Functions.

if i have a select like this:

select first_id, second_id, third_id, sum(amount) total,
grouping (first_id) g1,
grouping(second_id) g2,
grouping third_id) g3
from table_x
group by rollup(first_id, second_id,third_id)
having grouping(second_id)=1 and grouping(first_id)=0

..it works fine: the resulting totals are grouped by second_id (grouping(second)=1), without the global total (grouping(first_id)=0).
so far so good.
if i create a view based on the select (without the having-clause) - let4s say view1 - and try a statement like:

select * from view1
where g2=1 and g1=0

the result is unfortunately Ora-00600, Internal Error, with arguments [12325][4][][][][][][]

Is this a general limitation of Rollup and Grouping or is this a real bug????
Is there another way to distinguish between rollup-rows and others (without grouping)?

thanx, jim

p.s.: the same error occures if i use a subselect instead of a view.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 10 2002
Added on Dec 13 2001
1 comment
462 views