PDA

View Full Version : Select Records without relation.....


FatCat
05-18-2005, 03:59 PM
Hi @ll !

I've 2 tables and the relation between them is the id. I want only select the records from table A which are not present in table B!

Is there any suggestion!

Greets
FatCat

CyberSensei
05-18-2005, 09:30 PM
FatCat,

This may work in mySQL:

SELECT tableA.*
FROM tableA LEFT JOIN tableB ON tableA.ID = tableB.ID
WHERE (tableB.ID Is Null);

GL