MySQL Tutorial

A database system used with PHP.

MySQL HAVING

The MySQL HAVING Clause

The HAVING clause was added to SQL because the WHERE keyword cannot be used with aggregate functions.

Syntax:

SELECT column_name(s)
FROM table_name
WHERE condition
GROUP BY column_name(s)
HAVING condition;

Try It Yourself

Edit the code below and click Run to see the result live.

Source Code
Result
Topics