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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Grouping multiples rows

arizioMar 20 2009 — edited Mar 23 2009
Hi all,
here there is my problem:

drop table test purge;
create table test as
select 10 a, 20 b, 1 c, 2 d
from dual
union all
select 10 a, 20 b, 3 c, 4 d
from dual
union all
select 31 a, 20 b, 3 c, 4 d
from dual
union all
select 31 a, 20 b, 1 c, 2 d
from dual
union all
select 11 a, 21 b, 3 c, 4 d
from dual
union all
select 12 a, 21 b, 1 c, 2 d
from dual
union all
select 12 a, 21 b, 3 c, 5 d
from dual

I need to group all couples (A,B) having same rows (C,D)

A B C D GROUP_ID
10 20 1 2 1
10 20 3 4 1
---
11 21 3 4 2
---
12 21 1 2 3
12 21 3 5 3
---
31 20 3 4 1
31 20 1 2 1

Riccardo
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 20 2009
Added on Mar 20 2009
19 comments
2,991 views