Query editor
SELECTDATE_FORMAT(BLOCK_TIME, '%Y-%m-%d') AS day,COUNT(DISTINCT HASH) AS N_TX,--Amount of TRX sent from sender to recipient (if any), measured in sun (1 TRX = 10^6 sun)sum(value/10e6) as txn_amount_trx,sum(value/10e6*t2.price) as tnx_amount_usd,count(distinct to) as txn_to_usersFROM tron.transactions t1left join(SELECT symbol, DATE_TRUNC('day', minute) as day, avg(price) as priceFROM prices.usdWHERE blockchain IS NULLAND symbol = 'TRX'group by 1,2) t2 on cast(DATE_FORMAT(t1.BLOCK_TIME, '%Y-%m-%d') as timestamp)=cast(t2.day as timestamp)WHERE TRY_CAST(BLOCK_TIME AS DATE) >= CAST('2024-01-01' AS TIMESTAMP)GROUP BY 1ORDER BY DATE_FORMAT(BLOCK_TIME, '%Y-%m-%d') desc