Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Need help with update syntax using subquery

Need help with update syntax using subquery

From: mjohnson <crvmp3_at_hotmail.com>
Date: 5 Feb 2007 14:24:43 -0800
Message-ID: <1170714283.235153.302000@p10g2000cwp.googlegroups.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US