select
block_timestamp::date as date,
sum(case when vote_option_text = 'Yes' then 1 Else 0 End) as yes,
sum(case when vote_option_text = 'No' then 1 Else 0 End) as no,
sum(case when vote_option_text = 'Abstain' then 1 Else 0 End) as abstain,
sum(case when vote_option_text = 'NoWithVeto' then 1 Else 0 End) as withveto
from terra.core.fact_governance_votes
where tx_succeeded = 'TRUE'
and proposal_id = '3796'
group by date