Query editor
with data as (select COALESCE(SUM(CAST(value as decimal)/1e18), 0) as amount, 'trading' as type from erc20_arbitrum.evt_Transferwhere CAST(contract_address AS VARCHAR)='0x912ce59144191c1204e64559fe8253a0e49e6548'and CAST(to AS VARCHAR)='0xe21d366d5042f713c0c872591e610fb6a74c775b'and evt_block_time >= timestamp '2023-11-16 03:00')select SUM(CASE WHEN type='trading' THEN amount ELSE 0 END) as trading_amount,SUM(amount) as totalfrom data