Hello!

I have two tables. One contains invoices, one contains customers.
How do I delete customers that are not linked to any invoice.
The relation is one to many  (invoices --> customers).

I can select them with:
select customers.* from customers left join invoices on
invoices.cust_id=customers.id where invoices.id is null

but

delete from customers left join invoices on invoices.cust_id=customers.id
where invoices.id is null

fails.

Regards, Tadej


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to