RE: Help with DELETE and a subquery

2003-07-27 Thread Fatt Shin
Try this ... Delete from clients where 0 = (select count(*) from branches where branches.cid = clients.cid) Cheers FattShin -Original Message- From: Vikram Vaswani [mailto:[EMAIL PROTECTED] Sent: Friday, July 25, 2003 9:51 PM To: Nils Valentin; [EMAIL PROTECTED] Subject: Re: Help

Re: Help with DELETE and a subquery

2003-07-27 Thread Don Read
On 25-Jul-2003 Vikram Vaswani wrote: snip mysql SELECT * FROM branches; +--+-++--+ | bid | cid | bdesc | bloc | +--+-++--+ | 1011 | 101 | Corporate HQ | CA |

Re: Help with DELETE and a subquery

2003-07-25 Thread Nils Valentin
Hi Vikram, ignore both previous posts. Both don't work as wanted. I just realized that and I will come back to you after I created the tables and made it sure. Sorry for the confusion. Best regards Nils Valentin Tokyo/Japan 2003 7 25 14:42Nils Valentin : Hi Vikram, just read the post

Re: Help with DELETE and a subquery

2003-07-25 Thread Vikram Vaswani
Hey, Thanks for the help. I dont think this is possible, because MySQL will not let you delete from the same table you are reading. Is there an alternative way to do this using a subquery, you think? ignore both previous posts. Both don't work as wanted. I just realized that and I will come

Re: Help with DELETE and a subquery

2003-07-25 Thread Info
Estoy tomando el sol . q -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: Help with DELETE and a subquery

2003-07-24 Thread Nils Valentin
Hi Vikram, NULL is a special data type and requires special procedures. Try this: mysql delete from clients where cid = (select clients.cid from clients left join branches using (cid) WHERE ISNULL(bid); Please make NO SPACE betwen ISNULL and (bid) as otherwise wit will give you an syntax