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

Query question

Status
Not open for further replies.

ITbeast

IS-IT--Management
Jul 25, 2006
67
US
I'm trying create a report that shows all records that don't have a relationship to a record in another table. Can someone think of a way I can do this?

main_table
name_table

linked on id_number

want to see all records in main table that don't have a relational record in name_table
 
SELECT main_table.*
FROM main_table LEFT OUTER JOIN name_table
ON main_table.id_number = name_table.ID_NUMBER
WHERE name_table.id_number IS NULL

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top