NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
try fixing your query (Score:1)
SELECT first_name,
last_name,
order_date,
SUM(COALESCE(price, 0)) AS total
FROM customer
LEFT JOIN orders ON customer.id = orders.customer_id
LEFT JOIN order_item ON orders.id = order_item.order_id
GROUP BY first_name, last_name, order_date
HAVING total 15
ORDER BY order_date ASC
there, fixed it for you. any math on a NULL needs to have the ability to deal with a non-NULL value. there is a standard SQL function just for this very issue.
Reply to This