Created
December 11, 2019 09:06
-
-
Save WietseWind/494effe011d469f790c0e8f1666d2e78 to your computer and use it in GitHub Desktop.
Find accounts with most account activations (XRPL, BigQuery)
This file contains 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
-- Remove the surrounding Q3 for a complete list of account activations | |
SELECT | |
Account, | |
COUNT(1) as AccountsActivated | |
FROM ( | |
SELECT | |
Q1.*, | |
Q2.Account, | |
Q2.hash | |
FROM ( | |
SELECT | |
Destination as ActivatedAccount, | |
MIN(LedgerIndex) as ActivatedInLedger | |
FROM | |
xrpledgerdata.fullhistory.transactions | |
GROUP BY | |
Destination | |
) Q1 | |
LEFT JOIN | |
xrpledgerdata.fullhistory.transactions Q2 ON ( | |
Q1.ActivatedInLedger = Q2.LedgerIndex | |
AND | |
Q1.ActivatedAccount = Q2.Destination | |
) | |
) Q3 | |
GROUP BY | |
Account | |
ORDER BY | |
COUNT(1) DESC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment