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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to join two collections?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Consider the following table:

Name Skill
---- -----
John ASP
John VB
John C++
George ASP
George Java
George C#
Tom C#
Tom C++

I want to find the people who has both the skills of ASP, and C#.

Apparently "Union" isnot the right command to use:
(Select Name from table where Skill="ASP") UNION
(Select Name from table where Skill="C#")

But what SQL command to use?

Thanks a lot.
 
One way to do it is to use or.
This is what the SQL would look like.

SELECT tblData.LastName, tblData.FirstName, tblData.MiddleName
FROM tblData WHERE (((tblData.LastName)="Smith")) OR (((tblData.LastName)="Jones"));

This is really easy with the query builder in access 97 or higher.

Let me know if this helps or if you need to ask more questions.

Guy Dervage
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top