superflyDistribution of Vote Changers By Their Number of Changes
    Updated 2022-11-24
    with firstvotes as (
    select voter,
    min (block_timestamp) as minvote1
    from osmosis.core.fact_governance_votes
    where proposal_id in ('362')
    and tx_status = 'SUCCEEDED'
    group by 1),

    firstvote1 as (
    select t1.voter,
    minvote1,
    vote_option
    from osmosis.core.fact_governance_votes t1 join firstvotes t2 on t1.voter = t2.voter and t1.block_timestamp = t2.minvote1
    where proposal_id in ('362')
    and tx_status = 'SUCCEEDED'),

    secondvotes as (
    select distinct t1.voter,
    t1.block_timestamp,
    t1.tx_id,
    t2.vote_option
    from osmosis.core.fact_governance_votes t1 join firstvote1 t2 on t1.voter = t2.voter and t1.block_timestamp > t2.minvote1 and t1.vote_option != t2.vote_option
    where proposal_id in ('362')
    and tx_status = 'SUCCEEDED'),

    table1 as (
    select t1.voter,
    count (distinct t1.tx_id) as votes_count
    from secondvotes t1
    group by 1)

    select case when votes_count = 1 then 'Changed Vote 1 Time'
    when votes_count = 2 then 'Changed Vote 2 Times'
    else 'Changed Vote More Than 2 Times'
    end as type,
    count (distinct voter) as Voters_Count
    Run a query to Download Data