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

Home -> Community -> Usenet -> c.d.o.server -> Re: simple sql question

Re: simple sql question

From: LJS <ljstra_at_delicatech.com>
Date: Fri, 08 Jan 1999 12:30:08 -0600
Message-ID: <36964EB0.5A26693E@delicatech.com>


Jonathan's solution won't work. It will return the error: ORA-01427: single-row subquery returns more than one row.

Jonathan Gennick wrote:

> Probably something like:
>
> update table_a a
> set f1 = (select b.f1
> from table_b b
> where a.f2 = b.f2
> and a.f1 <> b.f1);
>
> I think the above should do what you are after.
>
> Jonathan
>
> On Thu, 07 Jan 1999 20:45:16 GMT, susana73_at_hotmail.com
> wrote:
>
> >I am an ingres developer and new in oracle. I have the following simple
> >Ingres SQL and am wondering how to change it to SQL in Oracle. Thanks!
> >
> >UPDATE table_a a
> >FROM table_b b
> >SET f1 = b.f1
> >WHERE a.f2 = b.f2
> >AND a.f1 != b.f1;
> >
> >Susan
> >
> >-----------== Posted via Deja News, The Discussion Network ==----------
> >http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Received on Fri Jan 08 1999 - 12:30:08 CST

Original text of this message

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