Re: Update Query

From: Ivica Dimjasevic <remove_smokesoft_at_email.hinet.hr>
Date: Sat, 2 Mar 2002 14:14:33 +0100
Message-ID: <a5qjgr$d4h8$1_at_as201.hinet.hr>


"Christopher Parker" <cparker2_at_jam.rr.com> wrote in message news:o1Yf8.43071$6j2.2295572_at_typhoon.austin.rr.com...
> I new to using Oracle, I've been using Access for a long time... so I'm
> trying to get used to differences in syntax of the different SQL. I'm
 having
> a problem with update queries.
>
> I can write a sql statement to update a field in a table for a certain
> value... even those who match values from another table. The part I
 haven't
> been able to find an example of is "How do you write an update of say
 field
> 1 of Table A where field 2 equals field 2 from Table B? Also the value for
> table A.field 1 = table B.field 1"
>
> Curious

I'm not sure but I think you want to do this:

update tableA a
  set field1 = (select b.field1 from tableB b

                       where a.field2 = b.field2);


Ivica Received on Sat Mar 02 2002 - 14:14:33 CET

Original text of this message