Last active
September 27, 2018 14:23
-
-
Save WietseWind/b21bf6289a19237cfbca921cd62e29b8 to your computer and use it in GitHub Desktop.
Google BigQuery, Top 5 Transactions / Account
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
SELECT | |
COUNT(1) as TxCount, | |
MIN(LedgerIndex) as MinLedger, | |
MAX(LedgerIndex) as MaxLedger, | |
COUNT(DISTINCT LedgerIndex) as LedgersWithTxCount | |
FROM | |
xrpledgerdata.fullhistory.transactions |
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
SELECT | |
STRING_AGG(DISTINCT TransactionType) as TransactionType, | |
Account, | |
COUNT(Destination) as TxCount, | |
SUM(AmountXRP) as SumXRPDrops, | |
SUM(Fee) as SumFeeDrops, | |
MIN(LedgerIndex) as AccMinLedger, | |
MAX(LedgerIndex) as AccMaxLedger | |
FROM | |
xrpledgerdata.fullhistory.transactions | |
WHERE | |
AmountXRP IS NOT NULL | |
AND | |
TransactionType = 'Payment' | |
GROUP BY | |
Account | |
ORDER BY | |
COUNT(Destination) DESC | |
LIMIT 5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment