Finding records in one table that exist in another is what IN() and EXISTS() are for. In general, if the column(s) are indexed, EXISTS() will be more efficient.
SELECT Id, col2, col3 FROM Data WHERE EXISTS ( SELECT * FROM All_Id WHERE Data.Id = All_Id.Id );
In reply to Re^3: SQL Select
by chacham
in thread SQL Select
by Scully4Ever
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |