Last active
February 12, 2021 02:14
-
-
Save rifkiamil/04b3998edacf2dc79b26147a39033d5b to your computer and use it in GitHub Desktop.
Satoshi Nakamoto sent 50 BTC to Hal Finney in block 170
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
# Find Bitcoin transaction | |
SELECT | |
bt.hash, | |
bt.block_timestamp, | |
CAST(bi.value AS NUMERIC)/100000000 as InputValueBTC, | |
CAST(bo.value AS NUMERIC)/100000000 as OutputValueBTC | |
FROM | |
`bigquery-public-data.crypto_bitcoin.transactions` AS bt | |
left outer join (Select transaction_hash, Sum(value) as value From `bigquery-public-data.crypto_bitcoin.inputs` GROUP BY transaction_hash) AS bi ON bt.HASH = bi.transaction_hash | |
left outer join (Select transaction_hash, Sum(value) as value From `bigquery-public-data.crypto_bitcoin.outputs` GROUP BY transaction_hash) AS bo ON bt.HASH = bo.transaction_hash | |
WHERE | |
bt.HASH = 'f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment