Hi Neil,
what you need is a LEFT JOIN:
SELECT a.*
FROM TableA a
LEFT JOIN TableB b ON a.ID = b.ID (assuming ID is what you relate the
                                   tables on )
WHERE b.ID IS NULL;

should hopefully do what you want.

/Johan

Neil Tompkins skrev:
Hi,
I've two tables. What query do I need to use to get a list of all records from table A where table B doesn't contain a a mathing record. For example TableA
ID
Name
TableB
Date
ID
Name
Thanks
Neil
_________________________________________________________________
Be one of the first to try Windows Live Mail.
http://ideas.live.com/programpage.aspx?versionId=5d21c51a-b161-4314-9b0e-4911fb2b2e6d


------------------------------------------------------------------------

No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.11.3/423 - Release Date: 2006-08-18

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to