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.

SQL to Group

674955Mar 29 2011 — edited Mar 30 2011
Hi All,

I need some help in Grouping the below table
with temp_tab as (
SELECT 1as ID ,'ABC' as name from dual union all
SELECT 1,'XYZ' from dual union all
SELECT 2,'123' from dual union all
SELECT 2,'456' from dual union all
SELECT 11,'ABC' from dual union all
SELECT 11,'XYZ' from dual union all
SELECT 22,'123' from dual )
SELECT * FROM temp_tab;
Here ID and 1 and 11 have same number of rows with same value but 2 and 22 has only 1 row in match
Final output has to be

ID NAME
1  'ABC'
1  'XYZ'
2  '123'
2  '456'
22 '123'
Since 1 and 11 have the same number of rows and same value I want them to be display only the first set

can some one help me??
This post has been answered by Boneist on Mar 29 2011
Jump to Answer

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Apr 27 2011
Added on Mar 29 2011
10 comments
525 views