Jump to content


Photo

UPDATE from field in other table


  • Please log in to reply
1 reply to this topic

#1 lemarsu

lemarsu
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 06 April 2003 - 10:23 AM

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

#2 Kriek

Kriek
  • Members
  • PipPipPip
  • Advanced Member
  • 31 posts
  • LocationFlorida

Posted 08 April 2003 - 12:23 AM

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]
Jon Kriek ยท PHP Freaks
Sometimes the need to mess with their heads ...
... outweighs the millstone of humiliation.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users