RE: HiveSQL: Claim Reward Balances

avatar

You are viewing a single comment's thread:

You can do the whole thing with one SQL query:

SELECT
   reward_hbd,
   reward_hive,
   reward_vests * (SELECT hive_per_vest FROM DynamicGlobalProperties) AS reward_HP,
   timestamp
FROM
   TxClaimRewardBalances
WHERE
   account = '{account_name}'
   AND timestamp BETWEEN '{start_date}' AND '{end_date}'
ORDER BY
   timestamp DESC

The query optimizer will take care of executing your subquery only once. This way, you generate only one round trip to HiveSQL ;)



0
0
0.000
0 comments