Home » SQL & PL/SQL » SQL & PL/SQL » update a column using a column from another table
update a column using a column from another table [message #233536] Thu, 26 April 2007 08:28 Go to next message
bollamha
Messages: 5
Registered: April 2007
Junior Member
Hi

update a column using a column from another table.

There are two fieldnames comman in both tables.

Can you please post a sample procedure code.

Thank you
Hari

[Updated on: Thu, 26 April 2007 08:29]

Report message to a moderator

Re: update a column using a column from another table [message #233539 is a reply to message #233536] Thu, 26 April 2007 08:37 Go to previous message
Michel Cadot
Messages: 64119
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Assuming common column is OPK:
update tab1 set col1=(select col2 from tab2 where tab2.pk = tab1.pk);

Regards
Michel
Previous Topic: command to number
Next Topic: adding new colum / salary increase by 15% expressed
Goto Forum:
  


Current Time: Tue Dec 06 10:06:12 CST 2016

Total time taken to generate the page: 0.08473 seconds