Moetergov5
    Updated 2023-01-23
    with raw as ( select
    *,row_number()over(partition by voter order by BLOCK_TIMESTAMP asc ) as n
    from terra.core.fact_governance_votes
    )



    select
    iff(n=1,'first time voter' , 'other') as type ,
    VOTE_OPTION_TEXT,
    count (distinct tx_id) as Votes_Count,
    count (distinct voter) as Voters_Count
    from raw
    where TX_SUCCEEDED = 'TRUE'
    and proposal_id = '3795'

    group by 1,2
    order by 3 desc

    Run a query to Download Data