web3-proxy/docs/top 100 rpc keys.sql

7 lines
308 B
MySQL
Raw Permalink Normal View History

2023-08-08 01:35:10 +03:00
SELECT SUM(`sum_credits_used`) as sum, rpc_accounting_v2.rpc_key_id, rpc_key.user_id, concat("0x", hex(user.address)) as address, user.email
2023-08-08 01:25:10 +03:00
FROM `rpc_accounting_v2`
JOIN rpc_key ON rpc_accounting_v2.rpc_key_id=rpc_key.id
JOIN user on rpc_key.user_id=user.id
GROUP BY `rpc_key_id`
ORDER BY sum DESC
2023-08-08 01:35:10 +03:00
LIMIT 100