MOHAMAD23Mango
Updated 2022-08-16
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
›
⌄
with mango as (
select count (distinct VOTER) as unique_members , count (distinct TX_ID) as Total_votes , count (distinct PROPOSAL) as number_of_proposals , min (BLOCK_TIMESTAMP) as date_of_creation , 1 as o
from solana.core.fact_proposal_votes
where REALMS_ID = 'DPiH3H3c7t47BMxqTxLsuPQpEC6Kne8GA9VXbxpnZxFE' and SUCCEEDED = 'TRUE'
),
last_proposal as (
select min(BLOCK_TIMESTAMP) as date_of_last_proposal , PROPOSAL , 1 as oo
from solana.core.fact_proposal_votes
where REALMS_ID = 'DPiH3H3c7t47BMxqTxLsuPQpEC6Kne8GA9VXbxpnZxFE' and SUCCEEDED = 'TRUE'
group by 2
order by 1 desc
limit 1
)
select unique_members , Total_votes , number_of_proposals , date_of_creation , date_of_last_proposal
from mango
join last_proposal on mango.o=last_proposal.oo