Re: Update Query

From: MS <manjushelar_at_hotmail.com>
Date: 3 Mar 2002 14:50:59 -0800
Message-ID: <29ed5c29.0203031450.3394c8ef_at_posting.google.com>


Try this :
 update tableA a
   set field1 = value you want to set
   where exists (select 'x'

                 from tableB b
                 where b.field1 = a.field1
                 and   b.field2 = a.field2);

"Ivica Dimjasevic" <remove_smokesoft_at_email.hinet.hr> wrote in message news:<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 Sun Mar 03 2002 - 23:50:59 CET

Original text of this message