Home » SQL & PL/SQL » SQL & PL/SQL » HOW TO UPDATE TABLE WITH JOIN
HOW TO UPDATE TABLE WITH JOIN [message #237403] Mon, 14 May 2007 06:52 Go to next message
donind
Messages: 95
Registered: February 2007
Member
hi,

How to update a table with below join condition

Update tab1 a, tab2 b set a.name=b.name, a.num1=b.num1 where a.pno=b.pkno.


Its giving a syntax error.

Any help really appreciated.

Thanks in advance
Re: HOW TO UPDATE TABLE WITH JOIN [message #237406 is a reply to message #237403] Mon, 14 May 2007 06:56 Go to previous message
Michel Cadot
Messages: 64139
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
update 
  (select a.name aname, b.name bname, a.num1 anum1, b.num1 bnum1
   from tab1 a, tab2 b
   where a.pno = b.pkno
  )
set aname = bname, anum1 = bnum1
/

Regards
Michel
Previous Topic: Anonymous blocks.
Next Topic: Query date range
Goto Forum:
  


Current Time: Fri Dec 09 00:03:33 CST 2016

Total time taken to generate the page: 0.07520 seconds