Having (SQL)
From Wikipedia, the free encyclopedia
A HAVING
statement in SQL specifies that a SQL SELECT
statement should only return rows where aggregate values meet the specified conditions.
[edit] Examples
Returns a list of Department IDs whose total sales exceeded $1000 on the date of January 1, 2000, along with the sum of their sales on that date.
SELECT DeptID, SUM(SaleAmount) FROM Sales WHERE SaleDate = '01-Jan-2000' GROUP BY DeptID HAVING SUM(SaleAmount) > 1000
[edit] External links
|