Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Need help with update syntax using subquery
I'm new to PL/SQL and have a TSQL (MSSQL) background. Typically, if I
needed to do an update using a subquery I would do this:
update mytable set t1.col=t2.col from mytable t1 inner join othertable t2 on t1.ID=t2.ID
but that doesn't work in PL/SQL. But this seems to work:
update mytable t1 set (t1.col)=(select col from othertable where ID=t1.ID)
Is that the analogous syntax. It seems that this update is taking forever -- I would have expected it to return in a matter of seconds if not subsecond but it's been 20 minutes and it still hasn't completed and there are only 22K records. Is there a better way to do this?
thanks for your time! Received on Mon Feb 05 2007 - 16:24:43 CST