SteemSQL Tutorial: How to Get the Most Payout Authors in History?


@nationalpark has published quite a few posts on the most payout authors in history, and here is how it was done in SteemSQL just in case you want to get these data by yourself.

We know the payout posts are stored in Comments table thanks to SteemSQL. Now, we just need to group by author id and sum up all the payouts via fields total_payout_value (past payout) and total_pending_payout(posts not 7 days yet).

1
2
3
4
5
6
7
8
select top 100
    author, sum(total_payout_value) + sum(total_pending_payout_value)
from
    comments (NOLOCK)
group by
    author
order by
    sum(total_payout_value) + sum(total_pending_payout_value) desc
select top 100
    author, sum(total_payout_value) + sum(total_pending_payout_value)
from
    comments (NOLOCK)
group by
    author
order by
    sum(total_payout_value) + sum(total_pending_payout_value) desc

This takes time, as it needs to go through all authors and all posts… But eventually, it will return the most payout authors as we expect:

steemsql-top-authors SteemSQL Tutorial: How to Get the Most Payout Authors in History? mssql sql SteemIt

steemsql-top-authors

Remember, this payout includes the 25% curation rewards, for example, I slightly change the query to show my total payout:

1
2
3
4
5
6
7
8
select 
    author, sum(total_payout_value) + sum(total_pending_payout_value)
from
    comments (NOLOCK)
group by
    author
having
    author = 'justyy'
select 
    author, sum(total_payout_value) + sum(total_pending_payout_value)
from
    comments (NOLOCK)
group by
    author
having
    author = 'justyy'

And this gives me:

steemsql-authors-payout SteemSQL Tutorial: How to Get the Most Payout Authors in History? mssql sql SteemIt

steemsql-authors-payout

So roughly, I have earned slightly more than 11152.3 * 0.75 = 8364 SBD.

Let’s get back to the first query, you can add a date and time/date constraint e.g. only counting in the last 30 days.

1
2
where
    datediff(day, created, GetUTCDate()) between 0 and 30
where
    datediff(day, created, GetUTCDate()) between 0 and 30

Write more, have fun and steem on!

STEEM SQL Tutorial

You may also like: SteemSQL 教程 – 如何获取史上赚最多金的作者?

–EOF (The Ultimate Computing & Technology Blog) —

GD Star Rating
loading...
660 words
Last Post: SteemSQL Tutorial - How to Fix &;;;JSON text is not properly formated. Unexpected character '.' is found at position 0.&;;;?
Next Post: SteemSQL Tutorial - Get Most Single Payout Authors

The Permanent URL is: SteemSQL Tutorial: How to Get the Most Payout Authors in History?

Leave a Reply