Hi
What is the difference between a HAVING CLAUSE and a WHERE CLAUSE in SQL Server ?
Difference Between a HAVING CLAUSE and a WHERE CLAUSE
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
VulpesRank #55 · 29.2K reputationPosted Jul 11, 2012, 1:49 AM EDT
https://riteshshah.wordpress.com/2009/03/05/where-and-having-clause-in-microsoft-sql-server/
Satyapriya NayakRank #47 · 31.5K reputationPosted Jul 11, 2012, 3:51 AM EDT
Specifies a search condition for a group or an aggregate. HAVING can be used only with the SELECT statement. HAVING is typically used in a GROUP BY clause. When GROUP BY is not used, HAVING behaves like a WHERE clause. Having Clause is basically used only with the GROUP BY function in a query. WHERE Clause is applied to each row before they are part of the GROUP BY function in a query.
Thanks
Jignesh TrivediRank #16 · 50.3K reputationPosted Jul 11, 2012, 4:57 AM EDT
please refer,
http://blog.sqlauthority.com/2007/07/04/sql-server-definition-comparison-and-difference-between-having-and-where-clause/
http://www.codeproject.com/Articles/25258/Where-Vs-Having-Difference-between-having-and-Wher
it very good article.