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!

Query for values from one column based on values in another column

694834Apr 6 2009 — edited Apr 8 2009
Hi Guys,

I have two tables.
Table 1:

User_Id Cpnt_Id
1000 A00
1000 B00
2000 A00
3000 A00
3000 B00
4000 B00
5000 B00

Table 2:

Cpnt_Id
A00
B00

Now I want fetch all the User_Ids that have both A00 abd B00. i.e. in this example I nead 1000 and 3000 as my query result. There is no limit to number of Cpnt_Ids or users.

What is the best method to get the result?

Any help will be appreciated.

Thanks in advance

Regards,
Vinay

Edited by: user10981565 on Apr 6, 2009 9:02 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 6 2009
Added on Apr 6 2009
10 comments
417 views