|
The features on this page require a GENESIS64 Advanced license and are not available with GENESIS64 Basic SCADA . |
The HAVING keyword works conceptually the same way as WHERE, but HAVING specifies a search condition for a group or an aggregate.
Note: with HAVING, the predicates are evaluated after the aggregates have been calculated, whereas the WHERE predicate is applied before calculating aggregates.
The following query returns only customers that have placed more than twenty orders.
SELECT CustomerID, COUNT(OrderID) FROM Orders GROUP BY CustomerID HAVING COUNT(OrderID) > 20