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)='0x229df44fdbb4193c6c123bd9f2327163378589f5'and evt_block_time >= timestamp '2024-06-26 02:00'UNION ALLselect COALESCE(SUM(CAST(value as decimal)/1e18), 0) as amount, 'mlp' as type from erc20_arbitrum.evt_Transferwhere CAST(contract_address AS VARCHAR)='0x912ce59144191c1204e64559fe8253a0e49e6548'and CAST(to AS VARCHAR)='0x49734d859d55f34a5948b4c91c4b27d1ba98fda7'and evt_block_time >= timestamp '2024-06-26 02:00')select SUM(CASE WHEN type='trading' THEN amount ELSE 0 END) as trading_amount,SUM(CASE WHEN type='mlp' THEN amount ELSE 0 END) as mlp_amount,SUM(amount) as totalfrom data