Skip to content

Instantly share code, notes, and snippets.

@WietseWind
Created December 11, 2019 09:06
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 WietseWind/494effe011d469f790c0e8f1666d2e78 to your computer and use it in GitHub Desktop.
Save WietseWind/494effe011d469f790c0e8f1666d2e78 to your computer and use it in GitHub Desktop.
Find accounts with most account activations (XRPL, BigQuery)
-- 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