-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,20 @@ | ||
SELECT | ||
DATE(FROM_UNIXTIME(block.timestamp DIV 1000000)), | ||
COUNT(DISTINCT id) totalCount | ||
COUNT(DISTINCT all_transactions.txid) + COUNT(DISTINCT all_transactions.itxid) | ||
FROM | ||
iconation.block | ||
LEFT JOIN | ||
( | ||
SELECT | ||
transaction.id as txid, | ||
internal_transaction.id as itxid, | ||
transaction.block as blockid | ||
FROM | ||
transaction | ||
LEFT JOIN | ||
internal_transaction | ||
ON | ||
internal_transaction.transaction = iconation.transaction.id | ||
) as all_transactions | ||
ON all_transactions.blockid = iconation.block.id | ||
GROUP BY DATE(FROM_UNIXTIME(block.timestamp DIV 1000000)) |
20 changes: 20 additions & 0 deletions
20
sql/scripts/transactions_count_per_day_big_icx_transfer.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
SELECT | ||
DATE(FROM_UNIXTIME(block.timestamp DIV 1000000)), | ||
COUNT(DISTINCT all_transactions.txid) + COUNT(DISTINCT all_transactions.itxid) | ||
FROM | ||
iconation.block | ||
LEFT JOIN | ||
(SELECT | ||
transaction.id AS txid, | ||
internal_transaction.id AS itxid, | ||
internal_transaction.amount AS itxamount, | ||
transaction.amount AS txamount, | ||
transaction.block AS blockid | ||
FROM | ||
transaction | ||
LEFT JOIN internal_transaction ON internal_transaction.transaction = iconation.transaction.id | ||
AND internal_transaction.token_type = 0) AS all_transactions ON all_transactions.blockid = iconation.block.id | ||
WHERE | ||
-- Filter > 1000 ICX Transfers | ||
all_transactions.itxamount > 1000000000000000000000 or all_transactions.txamount > 1000000000000000000000 | ||
GROUP BY DATE(FROM_UNIXTIME(block.timestamp DIV 1000000)) |