Skip to content

Instantly share code, notes, and snippets.

@vtno
Created May 12, 2020 08:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vtno/f538bef834d0e02d584eb892e88707d0 to your computer and use it in GitHub Desktop.
Save vtno/f538bef834d0e02d584eb892e88707d0 to your computer and use it in GitHub Desktop.
-- rt = refund_transaction
-- st = source_transaction (refunded transaction)
-- rd = refund_details
SELECT *
FROM transactions AS st
INNER JOIN refund_details AS rd
ON st.transaction_id = rd.source_transaction_id
INNER JOIN transactions AS rt ON rt.transaction_id = rd.transaction_id
WHERE st.transaction_id = :transactionId
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment