[PHP-DB] Re: [PHP] the opposite of a join?

2007-10-03 Thread James Ausmus
On 10/3/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I have a company table and a contacts table. In the contacts table, there is a field called companyID which is a link to a row in the company table. What is the easiest way to query the company table for all the company rows whose

[PHP-DB] Re: [PHP] RE: the opposite of a join?

2007-10-03 Thread James Ausmus
On 10/3/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi J, Checkout this, SELECT * FROM tbl_company where id not in (SELECT companyID from tbl_contacts) Brilliant! This is exactly what I was looking for, and is quite logical/readable! Thanks to everyone for the ideas! J