STEEMSQL Tutorial - Count Total Interests Sent 办银行一个月共发了多少利息?(STEEMSQL 教程)

in #cn7 years ago (edited)


Image Credit: Pixabay.com

@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:

So, let's list them out using @arcange 's STEEMSQL , which stores the transactions at table TxTransfers

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.

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

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


Image Credit: steemsql.com

@justyy 办银行 已经刚好一个月了,这一个月一共发了多少利息呢?利息是每天英国时间(UTC时区)凌晨按年化率14.6%发的。

根据 这个代理查询工具 得知,今天一共有40人代理了7200 SP给 @justyy 。每天按7200SP需要支付 2.88 SBD。

这是几个支付的记录:

然后我们可以查询 STEEMSQL 中的 TxTransfers表格。这个表格记录了转帐的记录。

select 
    * 
from
    TxTransfers (NOLOCK)
where
    "from"='justyy' and
    memo like 'Thank you%' and
    datediff(day, timestamp, GetUTCDate()) between 0 and 30

其中 like用于匹配字符串,而百分号是通配符,用于匹配一个或者多个字符。

如果把 *(所有) 替换成 sum(amount) 那么我们就能得出这个月一共发了利息多少钱。

76.564 SBD !平均每天2.55 SBD。


@justyyhttps://justyy.com 的博主,在 @tumutanzi 大哥 的介绍下加入 STEEMIT,写些帖子挣些小钱养家糊口。


@justyy 也是CN 区的点赞机器人,对优质内容点赞,只要代理给 @justyy 每天收利息(年化率14.6%)并能获得一次至少2倍(VP 200%+)的点赞,大鱼 @htliao 都加入了这个计划(530 SP)表示支持。

  1. cn区最低保障系统 上线了!
  2. cn区低保计划(鼓励新人)真的适合你么?

STEEMSQL 教程 – 办银行一个月共发了多少利息?
STEEMSQL Tutorial – Count Total Interests Sent
SteemIt SP Delegation Tool 简易SP代理工具
Steemit 在线工具和API接口
SteemIt Tools and APIs

Sort:  

Thank you. I just started SQL, it's a great help!

哈,又往银行存了点!

多谢。

存款利率这么高,借款利率多少?银行的利润从哪里来?

赔本生意,赔本赚吆喝。

希望你的银行越办越旺!

谢谢,不过利息快发不起了

steemit上的资本家

那也是亏本的资本家。

Coin Marketplace

STEEM 0.19
TRX 0.15
JST 0.029
BTC 63626.66
ETH 2640.26
USDT 1.00
SBD 2.75