Find all rows from table1 that are NOT in table2, assuming that table1.col1 and table2.col2 are the key constraints.

SELECT * 
FROM   [table1] 
LEFT JOIN [table2] 
    ON [table1].[col1] = [table2].[col2]
WHERE [table2].[col2] Is Null;

In other words: Return all records in table1 where the id is null in table2.

Copyright © 2024 delaney. All rights reserved.