Coupon Code can be extracted on the Transactions table by selecting promotion_code_instance_id and join it with the Coupon Code table via coupon_code_id. Please check the sample SQL expression below:
SELECT TRANSACTION_ID, PROMOTION_CODE_INSTANCE_ID
FROM TRANSACTIONS
INNER JOIN COUPON_CODES ON PROMOTION_CODE_INSTANCE_ID = COUPON_CODE_ID
WHERE TRANSACTION_ID = yourtransactionID
No comments:
Post a Comment