Re: Help with DELETE and a subquery

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

RE: Help with DELETE and a subquery

2003-07-27 Thread Fatt Shin
DELETE and a subquery 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

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-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 ba

Re: Help with DELETE and a subquery

2003-07-24 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:42、Nils Valentin さんは書きました: > Hi Vikram, > > just

Re: Help with DELETE and a subquery

2003-07-24 Thread Nils Valentin
Hi Vikram, just read the post once more. I made a mistake. You want to delete the clients with no branches you said, so the command should look like mysql> delete from clients where cid = (select clients.cid from clients left join branches using (cid) WHERE ISNULL(clients.cid); Note that cid

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

Help with DELETE and a subquery

2003-07-24 Thread Vikram Vaswani
Hi all, I have the following two tables: mysql> SELECT * FROM clients; +-+-+ | cid | cname | +-+-+ | 101 | JV Real Estate | | 102 | ABC Talent Agency | | 103 | DMW Trading