I have two tables:
Table1: columns: tblID (unique, pk), data1, data2, etc
Table2: columns: tblID, data1, data2
Both tables have about 6000 rows.
What I want to do is find all rows in Table1 for which there is no related entry in Table2.
The dumb approach:
Select * from Table1, Table2 Where Table1.ID<>Table2.ID
basically yields an outer join with a bazillion records.
The programming approach:
for each record in Table1
Select * from table2 where table2.ID<>record.ID
if recordcount=0 then ...
next
would work, but this requires thousands of calls to the database.
There must be a better way. Would you please tell me how to do this.
Thanks!
----
Gerry Roston
gerry@pairofdocs.net
Table1: columns: tblID (unique, pk), data1, data2, etc
Table2: columns: tblID, data1, data2
Both tables have about 6000 rows.
What I want to do is find all rows in Table1 for which there is no related entry in Table2.
The dumb approach:
Select * from Table1, Table2 Where Table1.ID<>Table2.ID
basically yields an outer join with a bazillion records.
The programming approach:
for each record in Table1
Select * from table2 where table2.ID<>record.ID
if recordcount=0 then ...
next
would work, but this requires thousands of calls to the database.
There must be a better way. Would you please tell me how to do this.
Thanks!
----
Gerry Roston
gerry@pairofdocs.net