Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rifkiamil/62f7953652a899589d2972993994da39 to your computer and use it in GitHub Desktop.
Save rifkiamil/62f7953652a899589d2972993994da39 to your computer and use it in GitHub Desktop.
Full relational diagram - sql with partitioned field
SELECT
transactions.hash as transaction_hash,
transactions.block_hash,
transactions.block_number,
transactions.block_timestamp,
outputs.index,
outputs.script_asm,
outputs.script_hex,
outputs.required_signatures,
outputs.type,
outputs.addresses,
outputs.value
FROM `bigquery-public-data.crypto_bitcoin.transactions` as transactions,
transactions.outputs as outputs # no join needed due to recored type
WHERE transactions.hash = 'f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16'
AND transactions.block_timestamp_month = '2009-01-01'
LIMIT 100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment