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: Sub-select returning nulls

Re: Sub-select returning nulls

From: Ben Ryan <benryan_at_my-deja.com>
Date: Fri, 05 Nov 1999 04:01:25 GMT
Message-ID: <7vtkql$tls$1@nnrp1.deja.com>


In article <3821fb51.415619_at_news1.a2000.nl>,   jantah_at_big.hand.com (Jantah) wrote:
> I have an update query that looks something like this:
>
> UPDATE table1
> SET column1 =
> (SELECT column2
> FROM table2
> WHERE table1.columnA = table2.columnB)
>

I cannot test this as I do not have access to Oracle at work.

UPDATE table1
SET column1 = (SELECT NVL(column2,column1)

                 FROM table2, table1
                WHERE table1.columnA (+) = table2.columnB)

If one can UPDATE table_list then

UPDATE table1, table2
SET table1.column1 = table2.column2
WHERE table1.columnA = table2.columnB

which if the syntax is legal gets rid of the outer join.

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Thu Nov 04 1999 - 22:01:25 CST

Original text of this message

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