Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Update one table with values from another
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