roketos12
    Updated 2022-11-20
    with maintable as (
    select proposal_id,
    case when proposal_id = '362' then 'Proposal #362' else 'Other Recent Proposals' end as proposalID,
    count (distinct tx_id) as Votes_Count,
    count (distinct voter) as Voters_Count
    from osmosis.core.fact_governance_votes
    where proposal_id::numeric >= '300' and proposal_id::numeric <= '365'
    and tx_status = 'SUCCEEDED'
    group by 1,2),

    table1 as (
    select count (distinct tx_id) as Proposal_362_Votes,
    count (distinct voter) as Proposal_362_Voters
    from osmosis.core.fact_governance_votes
    where tx_status = 'SUCCEEDED'
    and proposal_id in ('362'))

    select 'Recent Proposals' as type,
    avg (votes_count) as Average_Votes_Count,
    avg (voters_Count) as Average_Voters_Count
    from maintable

    union ALL

    select 'Proposal #362' as type,
    Proposal_362_Votes,
    Proposal_362_Voters
    from table1
    Run a query to Download Data