Azinsolana 3-3 proposals
    Updated 2022-12-01
    with t1 as
    (select
    count(case when VOTE_CHOICE='YES' then 1 else null end) as yes,
    count(case when VOTE_CHOICE='NO' then 1 else null end) as no,
    count(case when VOTE_CHOICE is null then 1 else null end) as "null",
    PROPOSAL
    from
    solana.core.fact_proposal_votes
    group by PROPOSAL
    )

    (select
    count(*) as number , 'accepted' as psotion
    from
    t1
    where
    yes>no)

    union all

    (select
    count(*) as number , 'Rejected' as psotion
    from
    t1
    where
    yes<no)


    union all

    (select
    count(*) as number , 'nulls' as psotion
    from
    t1
    where
    "null">yes and "null">no)
    Run a query to Download Data