"Diana Castillo" <[EMAIL PROTECTED]> wrote on 01/28/2005 11:53:20 AM:
> how do I make a query that does this?
> update tbl_a set location_code=0 where tbl_a.country_id = (select id
from
> countries where has_zones=0)
>
The UPDATE statement (as of 4.0.4) allows you to update multiple tables at
That depends on what version of MySQL you are using. MySQL 4.1+ has
support for subselects, so you could do what you have there.
I'm assuming that you're running < 4.1, otherwise you would have tried
that code and found it to work...
You may have to get the result of (select id from countries w
[snip]
how do I make a query that does this?
update tbl_a set location_code=0 where tbl_a.country_id = (select id
from
countries where has_zones=0)
[/snip]
Read about multi-table updates here http://www.mysql.com/update
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mys