with tab1 as (
select
DELEGATOR_ADDRESS
from osmosis.core.fact_staking
where action like 'undelegate'
)
select
date_trunc('day', block_timestamp),
count(distinct DELEGATOR_ADDRESS)
from osmosis.core.fact_staking
where action like 'redelegate'
and DELEGATOR_ADDRESS in (select * from tab1)
group by 1