server/scripts/register/unpaid.sql

7 lines
247 B
MySQL
Raw Normal View History

2001-12-30 12:26:56 +01:00
select u.id ID, left(concat(firstname,' ',lastname, ' <',email,'>'),43) Name, sum(t.balance) Kontostand
from users u, transactions t
where u.id=t.user
and u.status!='CONFIRMED'
GROUP BY u.id
HAVING SUM(t.balance)<2.5;