Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Sub-select returning nulls
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
![]() |
![]() |