What is the difference between the WHERE and HAVING clauses?

0

The main difference is that the WHERE clause is used to filter records before any groupings are established, whereas the HAVING clause is used to filter values from a group. The below comparison chart explains the most common differences:

WHERE

HAVING

This clause is implemented in row operations.

This clause is implemented in column operations.

It does not allow to work with aggregate functions.

It can work with aggregate functions.

This clause can be used with the SELECT, UPDATE, and DELETE statements.

This clause can only be used with the SELECT statement.

Sql
asked Apr 14, 2023 at 22:19
Sign in to add a comment

0 Answers

0
📝 No answers yet!

Be the first to answer this interview question.

Your Answer

Sign in to post your answer and help the community.