Jump to content

Archived

This topic is now archived and is closed to further replies.

lemarsu

UPDATE from field in other table

Recommended Posts

I have written some SQL but it would not work under mysql (in the office DB2 and oracle are ok with this kind of sql)

 

the following sql is what I am trying to run :

 

 

UPDATE tableA, tableB

SET tableA.usergroupid=8

WHERE 

 tableB.userid= tableA.userid AND

 tableB.country= \'United Kingdom\' AND

 tableA.usergroupid=\'5\'



 

 

Can anyone please help....

 

Thanks

LeMarsu

Share this post


Link to post
Share on other sites
Starting with MySQL Version 4.0.4, you can also perform UPDATE operations that cover multiple tables

 

You need MySQL 4.0.4 to perform the query [link]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.