with flow_tbl1 as (select min(block_timestamp::date) as mi , proposer as p1 from flow.core.fact_transactions group by p1)
,flow_tbl2 as (select max(block_timestamp::date) as ma , proposer as p2 from flow.core.fact_transactions group by p2)
, flow_data as (select mi,ma, datediff('day',mi,ma) as range ,p1 from flow_tbl1 inner join flow_tbl2 on p1=p2)
select count(*), case
when range=0 then 'no returning'
when range > 0 then 'returning' end as retornot
from flow_data
group by retornot