having sql statement code example
Example 1: having keyword sql
Having keyword basically similar to if condition
Only returns true conditions
SELECT FIRST_NAME , COUNT(*)
FROM EMPLOYEES
GROUP BY FIRST_NAME
HAVING COUNT(*) > 1
Example 2: sql count having
SELECT COUNT( * )
FROM agents
HAVING COUNT(*)>1; --count is greater than 1