Query editor
WITH table1 AS (SELECTAVG(gas_price / POWER(10, 9)) AS avg_gas_price,SUM(gas_used) AS total_gas_used,SUM(gas_used * (gas_price / POWER(10, 18))) AS gas_paid_in_ftmFROM fantom.transactionsWHEREblock_time >= CURRENT_TIMESTAMP - INTERVAL '24' hour), table2 AS (SELECTAVG(price) AS priceFROM prices.usdWHEREsymbol = 'FTM' AND minute >= CURRENT_TIMESTAMP - INTERVAL '24' hour)SELECTavg_gas_price,total_gas_used,gas_paid_in_ftm,gas_paid_in_ftm * table2.price AS gas_paid_in_USDFROM table1, table2