Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: update with a join
Sybrand,
are the statements quoted below perfectly equivalent, I mean regarding NULL values the could be present in col1, col2 ?
In other words: is
(1) where (a,b) = (a2,b2)
exactly the same as
(2) where a = a2 and b = b2
?
In (2), if a (or b,a2,b2) is null, the
where condition is false. Does the same
apply to (1) ?
Thanks in advance
Alberto
> The correct syntax for a subquery on multiple columns is
> UPDATE tbl1 t1
> SET t1.col0 = 0
> WHERE
> (t1.col1, t1.col2)
> in
> (SELECT t2.col1, t2.col2 from tbl2 t2)
>
> Performance wise you would better
> update tbl1 t1
> set t1.col0 = 0
> where exists
> (select 'x'
> from tbl2 t2
> where t2.col1 = t1.col1
> and t2.col2 = t1.col2)
>
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Sun Oct 29 2000 - 04:51:28 CST
![]() |
![]() |