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: SQL Update question

Re: SQL Update question

From: Philippe ARNAUD <parnau_at_ctp.com>
Date: Fri, 11 Dec 1998 15:21:11 +0100
Message-ID: <74r9t3$6r6$1@concorde.ctp.com>


update tablea set value1 = 'XXX' where exists (select 1 from tableb where tableb.tableakey = tablea.key and value2 = 'ZZZ')

HTH Philippe

Rich D wrote in message <74ovt9$dd8$1_at_eve.enteract.com>...
>I am trying to update a column in a table, and I am using a subquery since
>the criteria involves a join.
>
>TableA
> key
> name
> value1
>
>TableB
> key
> tableakey
> value2
>
>Here is my SQL statement:
>
>update tablea set value1 = 'XXX' where tablea.key in
>(select tableb.tableakey from tablea, tableb where
>tablea.key = tableb.tableakey and
>value2 = 'ZZZ'
>
>My update of tableA depends on a value in a column in tableB. There will
be
>multiple records in tableB that meet the criteria.
>
>Am I on the right track? It's not working (SQL error - ORA-00936 missing
>expression).
>
>Thanks for any help,
>
>Rich Dolan
>
>
>
Received on Fri Dec 11 1998 - 08:21:11 CST

Original text of this message

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