Skip to content

Instantly share code, notes, and snippets.

@ontofractal
Last active December 29, 2016 14:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ontofractal/00f683bdbbfe4eb71724b1765ac56a08 to your computer and use it in GitHub Desktop.
Save ontofractal/00f683bdbbfe4eb71724b1765ac56a08 to your computer and use it in GitHub Desktop.
-- топ суммарной силы флагов от одного аккаунта другому
SELECT
voter,
author,
sum((vesting_shares * weight / 10000)) as weighted_vesting_flags
FROM golos_votes
JOIN golos_accounts ON (name = voter)
WHERE timestamp > '2016-12-01'
AND weight < 0
GROUP BY author, voter
order by weighted_vesting_flags asc
-- топ суммарной силы полученных флагов за декабрь
SELECT
author,
sum((vesting_shares * weight / 10000)) as weighted_vesting_flags
FROM golos_votes
JOIN golos_accounts ON (name = voter)
WHERE timestamp > '2016-12-01'
AND weight < 0
GROUP BY author
order by weighted_vesting_flags asc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment