Query editor
with a as (selectevt_block_time,'active' as status,jobKey--jobAddress,--ownerfrom powerpool_gnosis.PPAgentV2Randao_evt_RegisterJobwhere contract_address = 0xD6d094a2a2dB8ceB9c00ae719E37011f22B7a8Acunion allselectevt_block_time,casewhen isActive_ = true then 'active'else 'disabled' end as status,jobKeyfrom powerpool_gnosis.PPAgentV2Randao_evt_SetJobConfigwhere contract_address = 0xD6d094a2a2dB8ceB9c00ae719E37011f22B7a8Ac),b as (select *, row_number() over (partition by jobKey order by evt_block_time desc) as rn from a),c as (select * from b where rn = 1),jobs_count as (select count(*) as jobs_registered from c),active_jobs as (select count(*) as jobs_active from cwhere status = 'active')select jobs_registered, jobs_activefrom jobs_count cleft join active_jobs a on 1=1