Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subquery maybe? 1

Status
Not open for further replies.

dcushnie

Programmer
Feb 2, 2005
28
CA
I have a table called Completed_Courses.
It has 2 columns called Passport_ID and Course.
They are both the primary key because one Passport_ID can have completed one or more Course.
I need to query this table to find which Passport_ID's have a specific 5 courses completed and I can't figure out how to do it.
I think I need to use a subquery.

A helping hand would be much appreciated.
Thanks.
 
Code:
Select PassPort_ID

From Completed_Courses

Where Course IN ('C1', 'C2', 'C3', 'C4', 'C5' )

Group By PassPort_ID

Having Count(*) = 5
 
Golom you are one smart cookie.
And if I had a cookie I would give one to you.
Thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top