rakhisanjayaUntitled Query
Updated 2023-01-12
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
›
⌄
with table1 as (
select
voter as Voter2,
max(block_timestamp) as final_vote_time
from cosmos.core.fact_governance_votes
where proposal_id = {{Proposal_Number_Cosmos}}
group by 1 )
, table2 as (
select
vote_option
from table1 left outer join cosmos.core.fact_governance_votes
on final_vote_time = block_timestamp
and Voter2 = Voter
)
select
Case
when vote_option = 1 then 'Yes'
when vote_option = 2 then 'Abstain'
when vote_option = 3 then 'NO'
when vote_option = 4 then 'NO WITH VETO'
else 'NULL'
End as Voter_option,
count(*)
from table2
group by 1
Run a query to Download Data