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

Like This Post?

We have a lot more where that came from?

We only send really good stuff occasionally, promise.

Rajkumar SM

Leave a Comment

Your email address will not be published. Required fields are marked *

Share on facebook
Share on google
Share on twitter
Share on linkedin
Share on whatsapp

Recent Posts:

Scroll to Top
API Testing eBook