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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

update query?

Status
Not open for further replies.

CHUMPY

Programmer
Oct 8, 2002
37
GB

I have two tables a and b both conating fields x and y,
I wish to update table a field x with the value of table b field x where a.y=b.y;

update a set a.x=b.x where a.y=b.y

but this doesn't seem to work am I am missing something?

thanks Gareth
 
I think the correct syntax would be
UPDATE tablename
set columnname = ??=??
where ??=??
 
Hi Gareth,

The syntax is
update a
set a.x = (select b.x
from b
where b.y = a.y)

Thanks and Regards
Gunjan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top