Re: COMPLICATED UPDATE

2005-01-28 Thread SGreen
"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

Re: COMPLICATED UPDATE

2005-01-28 Thread Mat
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

RE: COMPLICATED UPDATE

2005-01-28 Thread Jay Blanchard
[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