English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Why we require Having clause?

2006-06-19 22:05:04 · 4 answers · asked by Bharat 1 in Computers & Internet Programming & Design

4 answers

HAVING is used to filter the results of a GROUP BY clause.
For example, you can select customers with a count of their orders, and use HAVING to filter only customers that placed 3 or more orders.

2006-06-19 22:13:25 · answer #1 · answered by OMG, I ♥ PONIES!!1 7 · 1 0

The HAVING clause is used in combination with the GROUP BY clause. It can be used in a SELECT statement to filter the records that a GROUP BY returns.

The HAVING clause is reserved for aggregate functions

2006-06-19 22:09:02 · answer #2 · answered by programmer 4 · 0 0

The HAVING clause, used with the GROUP BY clause, is known to lay out filter conditions in aggregate functions.

Syntax:
SELECT , aggregate_function(column_name)
FROM WHERE
GROUP BY column_name
HAVING aggregate_function(column_name) operator value;

For further help with MySQL concepts, refer to the following link:

2015-11-25 19:31:20 · answer #3 · answered by Bella 1 · 0 0

To Write a coudistion on the aggregate values in the query.

2006-06-19 22:26:04 · answer #4 · answered by madhusrp007 2 · 0 0

fedest.com, questions and answers