SQL HAVING – SQL Tutorial | Software Testing Material

SQL Having:

While using aggregate functions, we couldn’t use WHERE clause. We need to use SQL HAVING clause while using aggregate functions. The HAVING Clause places conditions on Groups created by the GROUP BY clause where as the WHERE Clause places conditions on the selected columns.


The HAVING clause must follow the GROUP BY clause in a query. If we use ORDER BY clause in a query then the HAVING clause must precede the ORDER BY clause.

To list out the number of customers in each country and that too the countries with more than 2 customers.

SQL Having

In the next tutorial, we will see How To Use LIKE OPERATOR in SQL

Check out the complete SQL Tutorial by clicking on below link:

SQL Tutorial – Complete

Sharing is caring.

Share on facebook
Share on twitter
Share on linkedin

Get our latest blog posts delivered to your inbox

Subscribe and get popular blog posts about software testing industry.


Leave a Comment