with june as
(select
delegator_address
from terra.staking
where date_trunc('day',block_timestamp) = '2021-06-30'
and action = 'delegate'
group by 1),
q1 as
(select
DISTINCT delegator_address
from terra.staking
where date_trunc('month',block_timestamp) between '2021-01-01' and '2021-03-31'
and action = 'delegate')
select A.delegator_address
from june A
join q1 B on A.delegator_address = B.delegator_address