Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Update query with join statement

user11432758Sep 25 2013 — edited Sep 26 2013

  Hi guys, would like to check how to write a update query with inner join statement ? The case is like that, I need to update PRD_ID on TBL A  as below, based on the lookup table information. The key are based on column A03 from both table with condition only select those records in   LOOKUP_TBL where PRD_ID = 110001 then update to TBL_A for those matched data and FIX_FLT = 1

  I've a update query and it work well in SQL SERVER but not ORACLE

Update A set PRD_ID = B.PRD_ID

FROM TBL_A A inner join LOOKUP_TBL B

on A.A03 = B.A03

AND A.FIX_FLT = 1 AND B.PRD_ID = '110001';

 

TBL_A

PRD_IDA03FIX_FLTTXNDATE
1A11110/23/2010
1A21110/24/2010
1A33210/25/2010
1A43210/26/2010
1A53110/27/2010

 

 

 

LOOKUP_TBL

PRD_IDA03REMARK
110001A1NULL
110001A2NULL
110005A3NULL
110005A4NULL
110001A5NULL
This post has been answered by SomeoneElse on Sep 25 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 24 2013
Added on Sep 25 2013
3 comments
11,760 views