1
UPDATE dwh.product_in_offer AS t 
SET (t.PRODUCT_BUCKET_TYPE_CODE,t.PRODUCT_BUCKET_TYPE_DESC,t.LAST_EDIT_TYPE,t.CREATE_ID,t.UPDATE_ID) = 
    (SELECT s.PRODUCT_BUCKET_TYPE_CODE, s.PRODUCT_BUCKET_TYPE_DESC, s.LAST_EDIT_TYPE, s.CREATE_ID, s.UPDATE_ID
     FROM dwh.product_in_offer_vw AS s
     WHERE create_id = 0
        AND t.PRODUCT_KEY = s.PRODUCT_KEY 
        AND t.OFFER_KEY=s.OFFER_KEY) 
INNER JOIN dwh.product_in_offer_vw p on t.PRODUCT_KEY=p.PRODUCT_KEY and t.OFFER_KEY=p.OFFER_KEY
WHERE  create_id = 0;

ERROR:Syntax error near INNER, offset 386 "..ND t.OFFER_KEY=s.OFFER_KEY) -->INNER<--"

Any idea ??

1
  • What database are you using? Commented Dec 23, 2014 at 12:15

1 Answer 1

2

The INNER JOIN clause has to go before the SET clause.

UPDATE dwh.product_in_offer AS t 
INNER JOIN dwh.product_in_offer_vw p on t.PRODUCT_KEY=p.PRODUCT_KEY and t.OFFER_KEY=p.OFFER_KEY
SET (t.PRODUCT_BUCKET_TYPE_CODE,t.PRODUCT_BUCKET_TYPE_DESC,t.LAST_EDIT_TYPE,t.CREATE_ID,t.UPDATE_ID) = 
    (SELECT s.PRODUCT_BUCKET_TYPE_CODE, s.PRODUCT_BUCKET_TYPE_DESC, s.LAST_EDIT_TYPE, s.CREATE_ID, s.UPDATE_ID
     FROM dwh.product_in_offer_vw AS s
     WHERE create_id = 0
        AND t.PRODUCT_KEY = s.PRODUCT_KEY 
        AND t.OFFER_KEY=s.OFFER_KEY) 
WHERE  create_id = 0;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.