Created
January 25, 2019 08:27
-
-
Save allenday/41d3a027f7dc01e169e25f222a4fdd68 to your computer and use it in GitHub Desktop.
Number of transacting partners per Bitcoin address
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 | |
txn_count, | |
COUNT(txn_count) AS num_addresses | |
FROM | |
( | |
SELECT | |
ARRAY_TO_STRING(inputs.addresses, '') AS addresses, | |
COUNT(DISTINCT `hash`) AS txn_count | |
FROM `crypto-etl-ethereum-dev.bitcoin_blockchain.transactions` AS txns | |
CROSS JOIN UNNEST(txns.inputs) AS inputs | |
GROUP BY addresses | |
) | |
GROUP BY txn_count | |
ORDER BY txn_count ASC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment