Difference between a HAVING CLAUSE and a WHERE CLAUSE?

What is the difference between a HAVING CLAUSE and a WHERE CLAUSE in SQL Statements?



Views: 3337 | Community Opinion: 4

Tags..  SQL SERVER  DBA  Database Developer  SQL Queries

Bookmark this page..



Ask a New Question Go to Home

Community Opinion/Answers
 
Param Said..

Both HAVING and WHERE clause used for specifying the search condition in SQL queries.

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 can be used for specifying the search criteria in SELECT, DELETE, UPDATE statements.




sreenivas Said..

we can't use Having with out GROUP BY function




mohan Said..

Good.




abc Said..

we can use HAVING without GROUP BY().






Register or Login to Post Your Opinion