PQL Having

PQL HAVING Clause
The HAVING clause was added to PQL because the WHERE keyword could not be used with aggregate functions.

PQL HAVING Example
We have the following "Orders" stable:

Now we want to find if any of the customers have a total order of less than 2000.

We use the following PQL statement:

The result-set will look like this:

Now we want to find if the customers "Pie" or "Macintosh" have a total order of more than 1500.

We add an ordinary WHERE clause to the PQL statement:

The result-set will look like this: