Sunday, January 6, 2019

Extract Coupon Code from a Transaction Record in ODBC

This article will show how to get the Coupon Code for a transaction record via ODBC.

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