Having
Having Specifies a search condition for a group or an aggregate. HAVING can be used only with the SELECT statement. HAVING is typically used in a GROUP BY clause. When GROUP BY is not used, HAVING behaves like a WHERE clause.
SELECT SalesOrderID, SUM(LineTotal) AS SubTotal
FROM Sales.SalesOrderDetail
GROUP BY SalesOrderIDFROM Sales.SalesOrderDetail
HAVING SUM(LineTotal) > 100000.00
ORDER BY SalesOrderID ;
0 comments:
Post a Comment