with raw as (SELECT
delegator_address, validator_address, count(tx_id) as countval
from terra.staking
where tx_status = 'SUCCEEDED' and action = 'delegate'
group by 1,2
having countval > 1
order by 1 desc)
select delegator_address, count(validator_address)
from raw
group by 1
order by 2 desc