with first_data as (
select count (distinct tx_id) as votes_362,
count (distinct voter) as voters_362
from osmosis.core.fact_governance_votes
where tx_status = 'SUCCEEDED'
and proposal_id in ('362'))
select 'Other Proposals' as category,
avg (total_count_of_votes) as votes_avg_count,
avg (total_count_of_voters) as voters_avg_count
from (select proposal_id,
case when proposal_id = '362' then 'Proposal #362' else 'Other Recent Proposals' end as proposals,
count (distinct tx_id) as total_count_of_votes,
count (distinct voter) as total_count_of_voters
from osmosis.core.fact_governance_votes
where proposal_id::numeric >= '300' and proposal_id::numeric <= '365'
and tx_status = 'SUCCEEDED'
group by proposal_id,2)
union ALL
select 'Proposal #362' as category,
Votes_362,
Voters_362
from first_data