対象のデータセットです。
https://bigquery.cloud.google.com/table/bigquery-public-data:ethereum_blockchain.transactions
昨日こちらで、上記データセットから
from_addressが重複しているものに関しては、日付(block_timestamp)が最新のもののみを残して他はdropする方法
で相関副問合せを使う(https://teratail.com/questions/175101)、とお伺いしました。
そのあと、上記のコードで重複dropした後のデータセットからさらに
hashが重複しているものに関しても、日付(block_timestamp)が最新のもののみを残して他はdropをしたい
ということを試みていますが、思うように動きません。
ロジックだけでも良いので、どのような手順で進めるか、わかる方がいらっしゃいましたらご教示頂けますでしょうか。
下記、私が書いたコードです
SELECT a.hash, nonce, transaction_index, from_address, to_address, value, value/100000000000000000, gas, gas_price, input, receipt_cumulative_gas_used, receipt_gas_used, receipt_contract_address, receipt_root, receipt_status, block_timestamp, block_number, block_hash FROM `bigquery-public-data.ethereum_blockchain.transactions` A WHERE to_address IN('0x6ebeaf8e8e946f0716e6533a6f2cefc83f60e8ab', '0x91b9d2835ad914bc1dcfe09bd1816febd04fd689') AND NOT EXISTS( SELECT 1 FROM `bigquery-public-data.ethereum_blockchain.transactions` WHERE a.hash=A.hash AND block_timestamp<A.block_timestamp ) AND NOT EXISTS( SELECT 1 FROM `bigquery-public-data.ethereum_blockchain.transactions` WHERE from_address=A.from_address AND block_timestamp<A.block_timestamp )
何卒よろしくお願いいたします
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/02/19 22:57