WITH firstvotes AS (
SELECT
voter,
block_timestamp,
tx_id,
vote_option_text
FROM
terra.core.fact_governance_votes
WHERE
proposal_id IN ('3665')
AND
tx_succeeded = TRUE
),
secondvotes AS (
SELECT DISTINCT
a.voter,
a.block_timestamp,
a.tx_id,
a.vote_option_text
FROM
terra.core.fact_governance_votes a
JOIN firstvotes b
ON a.voter = b.voter
AND a.block_timestamp > b.block_timestamp
WHERE
proposal_id IN ('3665')
AND
tx_succeeded = TRUE
)
SELECT
CASE
WHEN voter IN (
SELECT
voter
FROM
secondvotes