SQL HAVING CLAUSE

HAVING clause is used with aggregate functions.
WHERE cannot be used with aggregate functions.
The aggregate functions are the one that generate a single value from values in a column.

Example:

AVG(),COUNT(), FIRST(), LAST(), MAX(),MIN() amd SUM()..


SYNTAX :
SELECT column_name, aggregate_function(column_name)
FROM table_name
WHERE column_name operator value
HAVING aggregate_function(column_name) operator value 

Table Name 'customers'

id

name

age

city

bill

1Tom34Paris5300
2Jhony51London 400
3Ram64Delhi20000.7
4Simon23Portland32.65



Online Execute/Compile

Quantitative Aptitude
Reasoning
Programming
Interview