Query editor
with a as (selectevt_block_time,'active' as status,jobKey--jobAddress,--ownerfrom powerpool_polygon.PPAgentV2VRF_evt_RegisterJobwhere contract_address = 0xcdf80c73640a756d0810baba52f3d01280e5be32union allselectevt_block_time,casewhen isActive_ = true then 'active'else 'disabled' end as status,jobKeyfrom powerpool_polygon.PPAgentV2VRF_evt_SetJobConfigwhere contract_address = 0xcdf80c73640a756d0810baba52f3d01280e5be32),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