dashed-slug.net › Forums › CoinPayments.net Wallet Adapter extension support › Important Issue! › Reply To: Important Issue!
September 14, 2018 at 8:24 am
#4412
alexg
Keymaster
Assuming the table prefix is wp_
, and if the installation is not multisite, then the following query would show you the user ids, coins and balances that are negative:
SELECT
account,
symbol,
SUM( IF( amount > 0, amount - fee, amount ) ) AS balance
FROM
wp_wallets_txs
WHERE
status = 'done'
GROUP BY
account,
symbol
HAVING
balance < 0;
If you are on a multisite installation with multiple blogs, you should also group by blog_id:
SELECT
blog_id,
account,
symbol,
SUM( IF( amount > 0, amount - fee, amount ) ) AS balance
FROM
wp_wallets_txs
WHERE
status = 'done'
GROUP BY
blog_id,
account,
symbol
HAVING
balance < 0;