The HAVING clause was added to SQL because the WHERE keyword could not be used with aggregate functions.
We have the following "Purchases" table:
Now we want to find if any of the customers have a total order of less than 2000.
We use the following SQL statement:
The result-set will look like this:
Now we want to find if the customers "Karmen" or "Jensen" have a total order of more than 1500.
We add an ordinary WHERE clause to the SQL statement:
Your Query was successfully sent!