Created
April 14, 2025 18:28
-
-
Save mgild/4c2c69622b0fd314abead53cc98f1437 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH signer_lookup AS ( | |
SELECT | |
tx_id, | |
MAX(CASE WHEN signed THEN address END) AS signer | |
FROM account_activity | |
GROUP BY tx_id | |
) | |
SELECT | |
a.*, | |
s.signer | |
FROM | |
account_activity a | |
LEFT JOIN | |
signer_lookup s USING (tx_id) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment