Query editor
selectblock_time,transactions_info.stat_minute as stat_minute,"from","to",eth_amount --通过将value除以/power(10,18)来换算精度,18是以太坊的精度,price,eth_amount * price as usd_value,hashfrom(select --Select后跟着需要查询的字段,多个字段用空格隔开block_time,date_trunc('minute',block_time) as stat_minute --把block_time用date_trunc处理成分钟,方便作为主键去关联,"from","to",hash,value /power(10,18) as eth_amount --通过将value除以/power(10,18)来换算精度,18是以太坊的精度from ethereum.transactions --从 ethereum.transactions表中获取数据where block_time > date('2022-01-01') --限制Transfer时间是在2022年1月1日之后and "from" = 0x3DdfA8eC3052539b6C9549F12cEA2C295cfF5296and value /power(10,18) >1000 --限制ETH Transfer量大于1000order by block_time --基于blocktime做升序排列,如果想降序排列需要在末尾加desc) transactions_infoleft join --讲transactions_info与price_info的数据关联,关联方式为 left join(--prices.usd表里存的是分钟级别的价格数据selectdate_trunc('minute',minute) as stat_minute --把minute用date_trunc处理成分钟,方便作为主键去关联,pricefrom prices.usdwhere blockchain = 'ethereum' --取以太坊上的价格数据and symbol = 'WETH' --取WETH的数据) price_info on transactions_info.stat_minute = price_info.stat_minute --left join关联的主键为stat_minute