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!

Recursive query

341668Mar 21 2006 — edited Mar 22 2006
Hi,
I have 2 tables:
1) ct_group (group_id)
2) ct_group_contact(group_id, contact_id, group_flag)

contact_id can be a simple contact or a another group(marked by group_flag = 'Y').

If data looks like:
select * from group_id;
group_id
-------------
1
2
3
and
select * from ct_group_contact;

group_id contact_id group_flag
------------ --------------- ---------------
1 100 N
1 200 N
1 2 Y
1 3 Y
2 200 N
2 600 N
3 700 N
3 100 N

How can I get DISTINCT contact_id for a certain group_id (e.g. group_id = 1)

Thank you,

Monica
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 19 2006
Added on Mar 21 2006
5 comments
231 views