8 Lis
2007
8 Lis
'07
15:03
A.L.E.C pisze:
ICE wrote:
klientów czy ich komputery?
chodzi oczywiscie o klientow,a nie o ich komputery ;)
spróbuj jakoś tak:
SELECT DISTINCT c.id, c.lastname, c.name, COALESCE(cash.balance, 0) FROM customers c JOIN customerassignments a ON (a.customerid = c.id) LEFT JOIN ( SELECT SUM(value) AS balance, customerid FROM cash GROUP BY customerid ) cash ON (cash.customerid = c.id) WHERE a.customergroupid IN (3,5,25) OR (a.customerid = 4 AND (cash.balance != 0 AND cash.balance IS NOT NULL))
dzieki, Alec, jak zwykle jestes niezawodny ;) Twoje zapytanie oczywiscie dziala ;)
pozdrawiam ICE
_______________________________________________ lms mailing list lms@lists.lms.org.pl http://lists.lms.org.pl/mailman/listinfo/lms