Advertisement
Guest User

Bitstamp to Bitso acc 2 by tag

a guest
Apr 1st, 2019
702
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.72 KB | None | 0 0
  1. SELECT
  2.   DestinationTag,
  3.   COUNT(Destination) AS TxCount,
  4.   SUM(CAST(AmountXRP AS NUMERIC)) / 1000000 AS TotalXRP, -- Convert total drops to XRP, without scientific notation output.
  5.   MIN(EXTRACT(DATE FROM l.CloseTime)) AS FirstTransactionDate,
  6.   MAX(EXTRACT(DATE FROM l.CloseTime)) AS LastTransactionDate
  7. FROM
  8.   xrpledgerdata.fullhistory.transactions t
  9. JOIN
  10.   xrpledgerdata.fullhistory.ledgers l
  11. ON
  12.   t.LedgerIndex = l.LedgerIndex
  13. WHERE
  14.   Account = 'rDsbeomae4FXwgQTJp9Rs64Qg9vDiTCdBv'
  15.   AND
  16.   AmountXRP IS NOT NULL
  17.   AND
  18.   TransactionType = 'Payment'
  19.   AND
  20.   Destination = 'rLSn6Z3T8uCxbcd1oxwfGQN1Fdn5CyGujK'
  21.   AND
  22.   TransactionResult = 'tesSUCCESS'
  23. GROUP BY
  24.   DestinationTag
  25. ORDER BY
  26.   COUNT(Destination) DESC
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement