Hi,
I don't know if it is same but I think I had similar problem. Try this:

DELETE master_tbl,detail_tbl FROM master_tbl LEFT JOIN detail_tbl ON
master_tbl.ID=detail_tbl.ID WHERE .....

HTH,
Dusan


----- Original Message ----- From: "Scott Haneda" <[EMAIL PROTECTED]>
To: "MySql" <mysql@lists.mysql.com>
Sent: Thursday, January 05, 2006 9:53 AM
Subject: Joined delete where records may or may not exist


Hello, mysql 4.0.18-standard-log (yeah, I know, I need to update, the date
format changes are a nightmare :-))

I have two tables, cart, and products, I need to do this style delete:

First, I need to join the two tables on the cart.product_id = products.id
and delete those records where products.online = 0 and here is the bit that
I get stuck on, and where there is no matching products record.

--
-------------------------------------------------------------
Scott Haneda                                Tel: 415.898.2602
<http://www.newgeo.com>                     Novato, CA U.S.A.



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



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

Reply via email to