Query editor
select a.proposal_id, sum(if(Delegators is not null,votes-coalesce(holdings,0), 0)) as delegate_votes,sum(votes)-sum(if(Delegators is not null,votes-coalesce(holdings,0), 0)) as not_delegate_votesfrom (select proposal_id from query_3279950 where state = 'Executed' or state = 'Defeated' or state = 'Queued') aleft join query_3307477 bon a.proposal_id = b.proposal_idgroup by 1