SteemSQL Tutorial – Count Total Interests Sent


databasee SteemSQL Tutorial - Count Total Interests Sent mssql sql SteemIt

database

@justyy ‘s CN Bank has been running exactly a month now and it is giving out daily interests as SBD. I wonder how much interests I have sent out in the past 30 days.

According to this powerful online tool to check who have delegated SP to you, as of today, there are 40 delegators who generously delegate around 7200 SP to @justyy and @justyy sends them 14.6% APR daily interests and also try its best to upvote the delegator’s content worth of 200% delegated SP.

Here are a few examples of transactions:

3 days ago	Transfer 0.160 SBD to mrpointp	Thank you for supporting @justyy ! Your 400.38 SP gives you daily interests of 0.16 SBD (14% APR)
3 days ago	Transfer 0.160 SBD to sunnyjolly	Thank you for supporting @justyy ! Your 400.55 SP gives you daily interests of 0.16 SBD (14% APR)
3 days ago	Transfer 0.200 SBD to bobdos	Thank you for supporting @justyy ! Your 500.05 SP gives you daily interests of 0.2 SBD (14% APR)
3 days ago	Transfer 0.212 SBD to htliao	Thank you for supporting @justyy ! Your 530.37 SP gives you daily interests of 0.212 SBD (14% APR)
3 days ago	Transfer 0.264 SBD to eduter	Thank you for supporting @justyy ! Your 660.14 SP gives you daily interests of 0.264 SBD (14% APR)

So, let’s list them out using STEEMSQL , which stores the transactions at table TxTransfers.

1
2
3
4
5
6
7
8
select 
    * 
from
    TxTransfers (NOLOCK)
where
    "from" = 'justyy' and
    memo like 'Thank you%' and
    datediff(day, timestamp, GetUTCDate()) between 0 and 30
select 
    * 
from
    TxTransfers (NOLOCK)
where
    "from" = 'justyy' and
    memo like 'Thank you%' and
    datediff(day, timestamp, GetUTCDate()) between 0 and 30

the like operator matches the string according to pattern and the percentage % sign matches zero or more characters.

steemsql-txtransfer-examples SteemSQL Tutorial - Count Total Interests Sent mssql sql SteemIt

steemsql-txtransfer-examples

If you replace * with sum(amount) which will print out the total SBD sent:

76.564 SBD

I have sent out 76.564 SBD in the last 30 days! That is 2.55 SBD per day!

STEEM SQL Tutorial

You may also like: STEEMSQL 教程 – 办银行一个月共发了多少利息?

–EOF (The Ultimate Computing & Technology Blog) —

GD Star Rating
loading...
698 words
Last Post: The SteemIt SP Delegation Tool
Next Post: The Simple Risk Register for Project Management

The Permanent URL is: SteemSQL Tutorial – Count Total Interests Sent

Leave a Reply