You are viewing a single comment's thread from:

RE: HiveSQL - Top 50 #HIVE Reputable Users - HIVE POWER & #HBD in Savings they #HODL...

in Hive Statistics7 months ago

Using a join to compute users' HP is overkill and makes your queries less readable. Use variables:

DECLARE @HPV AS DECIMAL(18 ,8) = (SELECT hive_per_vest FROM DynamicGlobalProperties)

SELECT TOP 50 
    name, 
    reputation_ui, 
    vesting_shares * @HPV AS [Hive_Power]
FROM
    Accounts
ORDER BY 
    reputation_ui DESC
Sort:  

thank you @arcange for the query optimization. I will keep in mind moving forward. cheers

You're welcome @gungunkrishu. Glad to help.