-
Update statement with a inner join
Need some SQL help here ....
I am trying to convert this statement to Oracle, but I am getting an error. The statement is ...
update carrier b
set b.company_key = a.company_key,
b.carrier_name = a.carrier_name,
b.carrier = a.carrier,
b.carrier_code = a.carrier_code,
b.delivery_days = a.delivery_days,
b.ship_method = a.ship_method
from preload_carrier a inner join carrier on
a.carrier_key = carrier.carrier_key;
The error I am getting is
SQL> @update_carrier.sql;
from preload_carrier a inner join carrier on
*
ERROR at line 8:
ORA-00933: SQL command not properly ended
In Oracle I understand there is no 'INNER JOIN'. Should I do a select statement within the update statement.
Your input is highly appreciated.
-Chintzs
-
Try this:
Code:
update carrier b
set (company_key
,carrier_name
,carrier
,carrier_code
,delivery_days
,ship_method ) =
(select company_key
, carrier_name
, carrier
, carrier_code
, delivery_days
, ship_method
from preload_carrier a
where a.carrier_key = b.carrier_key)
where exists (
(select 1
from preload_carrier a
where a.carrier_key = b.carrier_key)
;
"The person who says it cannot be done should not interrupt the person doing it." --Chinese Proverb
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|