What is the difference between HAVING and WHERE clause in SQL?

  • HAVING is used for joining tables, and WHERE is used for filtering aggregates
  • HAVING is used for row-wise filtering, and WHERE is used for aggregate-wise filtering
  • WHERE is used for row-wise filtering, and HAVING is used for aggregate-wise filtering
  • WHERE is used with aggregate functions, and HAVING is used with row-wise conditions
The WHERE clause is used for row-wise filtering, whereas the HAVING clause is used for aggregate-wise filtering. This means that the WHERE clause filters individual rows before they are grouped, while the HAVING clause filters grouped rows after they are formed.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *