21.04.2019, 19:42
Функция SUM должна использоваться только совместно с функцией GROUP BY.
Code:
SELECT SUM(credit) as total_credit, playerid FROM table_bank WHERE status != 0 AND playerid IN (SELECT ID FROM table_accounts WHERE money > 0) GROUP BY playerid