On 25-Jul-2003 Vikram Vaswani wrote:
> mysql> SELECT * FROM branches;
> +--+-++--+
>| bid | cid | bdesc | bloc |
> +--+-++--+
>| 1011 | 101 | Corporate HQ | CA |
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
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]
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
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
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
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
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