What is the difference between a HAVING CLAUSE and a WHERE
CLAUSE?
Answer Posted / ravindran
1.WHERE clause can be used with SELECT,INSERT and UPADATE statements,where as HAVING clause can only be used with the SELECT statements.
2.WHERE filter after rows before aggregation(GROUPING),
where as,HAVING filters groups,after the aggregations are performed.
3.Aggregate functions cannot be used in the WHERE clause,unless it is in a sub query containing in a HAVING clause,where as,aggregate functions can be used in having clause.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Can two tables have the same primary key?
What do you know about normalization and de- normalization?
What is the difference between Triggers and Stored Procedure?
How do you size a resultset?
How to create an multi-statement table-valued function?
How to receive output values from stored procedures?
Why is there a performance difference between two similar queries where one uses union and the other uses union all?
how to overcome kernel isssues
Does group by or order by come first?
What do you understand by user-defined function in the sql server and explain the steps to create and execute a user-defined function in the sql server?
Can the “if update (colname)” statement be used in a delete trigger?
What is the difference between char and varchar2 datatype in sql?
What are the disadvantages of merge replication?
What is replication and database mirroring?
How to provide default values to stored procedure parameters?