Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UPDATE table1 based on table2 ---

Status
Not open for further replies.

link9

Programmer
Joined
Nov 28, 2000
Messages
3,387
Location
US
Hello all --

I have two tables, we'll call them table1 and table2. The link between the two is a column called 'link', and I need to be able to update table1 based on the value that is in table2 with the same 'link', but can't seem to get the syntax correct.

So here would be a JOIN between the two:

SELECT * FROM table1 INNER JOIN table2 ON table1.link = table2.link

and the column I need to update in table1 is called 'verb' -- also has the same name in table2.

What would be my syntax?

Thanks! :-)
Paul Prewett
penny.gif
penny.gif
 
got it:

update table1
set verb = new.verb
from table2 new inner join table1
on new.link = table1.link

:-)
penny.gif
penny.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top