Database - Introduction to SQL - Discussion

Discussion Forum : Introduction to SQL - General Questions (Q.No. 17)
The HAVING clause does which of the following?
Acts like a WHERE clause but is used for groups rather than rows.
Acts like a WHERE clause but is used for rows rather than columns.
Acts like a WHERE clause but is used for columns rather than groups.
Acts EXACTLY like a WHERE clause.
Answer: Option
No answer description is available. Let's discuss.
10 comments Page 1 of 1.

Manjula P said:   4 years ago
Example for having clause.

SELECT COUNT(CustomerID), Country.
FROM Customers.
GROUP BY Country.
HAVING COUNT(CustomerID) > 5;.

Vandna said:   4 years ago
Can anyone give a short example for HAVING please?

Deepamarisamy said:   5 years ago
Please explain HAVING and WHERE clause?

Kanimozhi said:   6 years ago
WHERE clause is used for filtering rows, while HAVING clause is used for filtering groups.

Chandra said:   9 years ago
In the group By class only we can use Having because in that we are checking more records. In Where we can't check group it is only applicable for only one condition.

Ashish said:   1 decade ago
"having " clause is act as an constraint/condition whenever we use group by clause.

Ragunandhan said:   1 decade ago
The HAVING clause was added to SQL because the WHERE keyword could not be used with aggregate functions.

Pooja said:   1 decade ago
"Where" is a kind of restiriction statement. You use where clause to
restrict all the data from DB.Where clause is using before result
retrieving. But Having clause is using after retrieving the data.
Having clause is a kind of filtering command.

Dishant said:   1 decade ago
Please tell me that or give example of this HAVING query.

Kiran said:   1 decade ago
You cannot use an aggregation function to limit rows in WHERE clause. Use HAVING clause to limit the groups returned by GROUP BY clause.

Post your comments here:

Your comments will be displayed after verification.