Database - Introduction to SQL - Discussion

Discussion Forum : Introduction to SQL - General Questions (Q.No. 17)
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
Explanation:
No answer description is available. Let's discuss.
Discussion:
10 comments Page 1 of 1.

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.
(1)

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

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.

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

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

Chandra said:   1 decade 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.
(1)

Kanimozhi said:   9 years ago
WHERE clause is used for filtering rows, while HAVING clause is used for filtering groups.
(1)

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

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

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

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

Post your comments here:

Your comments will be displayed after verification.