mohamadreza221166votes_status_over_months
Updated 2022-06-19
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
›
⌄
WITH Lil_Nouns_Votes AS(
SELECT T1.TX_HASH, T1.BLOCK_TIMESTAMP,
T1.EVENT_INPUTS:support::string AS support,
T1.EVENT_INPUTS:voter::string AS voter,
T1.EVENT_INPUTS:votes::NUMERIC AS votes
FROM ethereum.core.fact_event_logs T1
WHERE T1.TX_STATUS = 'SUCCESS'
AND T1.EVENT_REMOVED = 'false'
AND T1.EVENT_NAME = 'VoteCast'
--AND contract_address = '0x5d2c31ce16924c2a71d317e5bbfd5ce387854039'
)
SELECT YEAR(BLOCK_TIMESTAMP) || ' ' || MONTHNAME(BLOCK_TIMESTAMP) AS date_,
sum(case when support = '0' then 1 else 0 END ) AS number_of_false_votes,
sum(case when support = '1' then 1 else 0 END ) number_of_true_votes,
sum(case when support = '2' then 1 else 0 END ) number_of_abstain_votes
FROM Lil_Nouns_Votes T1
group BY YEAR(BLOCK_TIMESTAMP), MONTHNAME(BLOCK_TIMESTAMP)
ORDER BY YEAR(BLOCK_TIMESTAMP) ASC, MONTHNAME(BLOCK_TIMESTAMP) ASC
Run a query to Download Data