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 -> Oracle SQL - UPDATE using complex join

Oracle SQL - UPDATE using complex join

From: JD Uhler <john.uhler1_at_dot.state.wi.us>
Date: 8 Oct 2002 15:01:04 -0700
Message-ID: <33e91ac6.0210081401.53d2b447@posting.google.com>


Here is my scenario. I would like to UPDATE data in table APPLE, but the UPDATE needs criteria from tables PRODUCER and FARM.

I don't want to update all GREEN ORGANIC apples bushels on the all of SHINY APPLE's farms (SMITH FARM, JOHNSON FARM, etc.). I only want to update the bushels of apples on the JONES FARM.

Pseudeocode:

UPDATE APPLE
SET BUSHEL_PRICE='5.20', WEIGHT='10.5'
WHERE
COLOR='GREEN' AND
TYPE='ORGANIC' AND
PRODUCER.NAME='SHINY APPLE COMPANY' AND
FARM.LOCATION='JONES FARM' JOIN: PRODUCER.NAME=APPLE.NAME
JOIN: PRODUCER.LOCATION=FARM.LOCATION Changing the data structure is not a possibility at this time.

What SQL statement do I use?

Thank you

JD Received on Tue Oct 08 2002 - 17:01:04 CDT

Original text of this message

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