The SQL HAVING Clause helps you to specify conditions that filter which group results should appear in the final results.ell.
NOTE: HAVING Clause should always be followed by a GROUP BY Clause in a Query.
Following our approach with the PersonalInfo Table, let’s understand how HAVING CLAUSE is used. Below is the Demo Database
The query has grouped the Address, City and FirstName from PersonalInfo table to fetch count of PersonId>1
Figure 22.1. Select * from PersonalInfo;
Figure 22.2. HAVING CLAUSE ON PersonalInfo;
Want More SQL Deep Dives