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 one table with values from another

Re: Update one table with values from another

From: Rob <robsinn_at_home.pipex.com>
Date: Tue, 2 Oct 2001 17:06:26 +0100
Message-ID: <3bb9e685$0$8510$cc9e4d1f@news.dial.pipex.com>


update sales_table
set price_s = (select price_l

               from lookup
               where sales_table.item_s = lookup.item_l)
where item_s in (select item_l
                 from lookup)


GREGORY KNESER wrote in message <9pcke9$qai$1_at_netnews.upenn.edu>...
>Hello,
>
>Quick question for you today fictionalied below. I have a table
>(SALES_TABLE) with a set of values in it (they are identifiers for items
>in a store) and I want to update these identifiers with their price from
>the lookup table (LOOKUP).
>
>Table structures:
>
>
>SALES_TABLE:
>
>ITEM_S PRICE_S
>------- --------
>CARZ
>CARM
>BARBIE1
>CARZ
>CARZ
>
>
>LOOKUP:
>
>ITEM_L PRICE_L
>------- ---------
>CARZ 3.00
>CARM 15.00
>CARF 9.00
>BARBIE1 11.00
>BARBIE2 11.76
>
>So, how do I update the SALES_TABLE with the prices from the lookup table?
>
>Thanks for your help,
>Greg
>
>
>
>
Received on Tue Oct 02 2001 - 11:06:26 CDT

Original text of this message

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