Having is used in tandem with GROUP BY.
SELECT department, SUM(sales) as "Total sales" FROM order_details GROUP BY department HAVING SUM(sales) > 1000;
No comments:
Post a Comment