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 table

Re: Update table

From: Matthias Gresz <GreMa_at_t-online.de>
Date: 1997/10/28
Message-ID: <6343et$41i$1@news00.btx.dtag.de>#1/1

miguel wrote:
>
> SQL question:
>
> Table test1 ( A,B,C,D,E,F) Table test2 (A,B,C,D)
>
> I want to update column C and D from "test1" where test1.A=test2.A and
> test1.B=test2.B and (test1.C<>test2.C or test1.D<>test2.D).
>
> Can someone help me?
> Tanks

HI,

UPDATE test1
SET
C=value_c,
D=Value_d
WHERE
test1.A in
(Select t1.A
from
test1 t1, test2 t2
where
t1.A=t2.A
and
t1.B=t2.B
and
(t1.C<>t2.C or t1.D<>t2.D))

Assuming A is unique in test1.

-- 
Regards

M.Gresz    :-)
Received on Tue Oct 28 1997 - 00:00:00 CST

Original text of this message

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