- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Difference between Where and Having
Both Where and Having are the two keywords used in SQL query to filter and summarize the data that is retrieved from database based on given condition.
On the basis of features of both keywords we can distinguish between Where and Having as follows −
|1||Definition||WHERE clause in SQL query specifies search conditions for the rows returned by the it and limits rows to a specific row-set. In case if user wants to get the particular records based on some specific classification or condition then using ‘where’ clause is useful.||The WHERE clause is used to specify the required condition (on aggregate values) while selecting the rows of a table.|
|2||Execution||As per the order of execution of clauses, the WHERE clause is executed before the execution of the GROUPBY CLAUSE and, after the execution of the FROM clause.||On other hand HAVING clause is executed after groups are created.|
|3||GroupBy compatibility||WHERE clause can be used with GroupBy clause in a SQL query.||On other hand, Having clause does not have compatibility with GroupBy clause.|
|4||Row selection||WHERE clause select the rows before grouping of result.||On other hand Having clause selects the rows after grouping.|
|5||Aggregate Function||WHERE clause cannot contain the aggregate function.||On other hand HAVING clause can contain the aggregate function.|
- Difference Between Where and Having Clause in SQL
- WHERE vs HAVING in MySQL?
- Difference between C# and .Net
- Difference between Process and Thread
- Difference between Concurrency and Parallelism
- Difference between localhost and 127.0.0.1?
- Difference between JCoClient and JCoDestination
- Difference between String and StringBuffer.
- Difference between StringBuffer and StringBuilder.
- Difference between CPU and GPU
- Difference between TDM and FDM
- Difference between CRT and LCD
- Difference between GUI and CUI
- Difference between LAN and WAN
- Difference between LAN and MAN