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 -> Re: Update SQL differences

Re: Update SQL differences

From: Dante <dnotari_at_my-dejanews.com>
Date: Fri, 07 May 1999 17:27:25 GMT
Message-ID: <7gv7pm$j97$1@nnrp1.deja.com>


Carlos,
  update tablename t
  set t.columname = (select t1.columname

                     from othertable t1
                     where t.id = t1.id)

   will work fine and optimized ... if
   you have an index on t1.columname.

Regards
Dante
In article <7gv72m$ih9$1_at_nnrp1.deja.com>,   cpereyra_at_ix.netcom.com wrote:
>
>
> In Sybase, the following command will succeed.
>
> update tablename
> set t.columname = t1.columname
> from tablename t, othertable t1
> where t.id = t1.id
>
> In Oracle it fails with a syntax error. I know that
> I can write a correlated subquery and get the same
> results, but I wonder if there is a different way.
> If the correlated subquery is the only way in Oracle,
> is the subquery flattened into a join by the optimizer?
>
> Thanks,
>
> Carlos Pereyra
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
>

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Fri May 07 1999 - 12:27:25 CDT

Original text of this message

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