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!

Unmaching documents from 3 child tables

Status
Not open for further replies.

ovidiucotarlea

Programmer
Sep 26, 2001
2
RO
Hi, this is my problem:
I have a parent table and 3 child tables and i want to find all the unmatching documents from the parent table.

thank you
 
If you mean you need to find all of the rows in the parent table that have no child rows, you could try

SELECT p_identifier FROM parent_table
WHERE p_identifier NOT IN (SELECT c1_identifier FROM child1)
AND p_identifier NOT IN (SELECT c2_identifier FROM child2)
AND p_identifier NOT IN (SELECT c3_identifier FROM child3);

However, this may take awhile, depending on the sizes of your tables.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top