What is the difference between a HAVING CLAUSE and a WHERE CLAUSE?

What is the difference between a HAVING CLAUSE and a WHERE CLAUSE?

There are a many differences b/w HAVING CLAUSE and a WHERE CLAUSE :                Having Clause is mainly used for the Group By function Its only with the GROUP BY function in a query, But In case of WHERE Clause is using only for rows, Its applied to each row before they are part of the GROUP BY function in a query. Both of Clouses are mainly specify a search condition for a group or an aggregate. But differences are there in the case of  HAVING CLAUSE, it can be used only with the SELECT statement. And It is typically used in a GROUP BY clause. Even GROUP BY is not used, HAVING behaves something like a WHERE clause. 

By:UMANG
Date:2010-01-09 00:00:00

Post Your Answers


User Email:

User Name:
Answers:

Related SQL Subjective Links

SQL Subjective interview questions and answers for experienced and fresher