What is the difference between having and where clause?
Answers were Sorted based on User's Feedback
where clause used to impose conditions in any dml operation
ex:
selct * from emp where empid=10
having clause used to impose conditions on group data
ex:
select sum(sal),avg(sal),count(*) from emp
having avg(sal)>2000
Is This Answer Correct ? | 9 Yes | 0 No |
Answer / sd
Where clause operates on the selection before the rows are
actually grouped.
Hence , Try to add as many condition as possible in where
clause instead of having to boost the SQL query performance.
Is This Answer Correct ? | 8 Yes | 2 No |
Answer / vinay singh
We can't use Where clause with aggregate function and Having
clause always use with aggregate function.
**Vinay Singh
Is This Answer Correct ? | 6 Yes | 2 No |
Answer / kundan ravi
having clause alwaye use with aggregate functions and where
clause use for conditions but not with aggregate functions.
Is This Answer Correct ? | 2 Yes | 3 No |
How many types of the database links?
How to populate a table in sql server?
What are user-defined functions (udfs) in sql server?
What is recursion? Is it possible for a stored procedure to call itself or recursive stored procedure? How many levels of sp nesting are possible?
Do you know what is replace and stuff function in sql server?
What is row-level compre?
What do you understand by check constraint in sql server?
Equi join and non equi join is possible with sql server?
What is the difference between an index and a unique index?
What about UPDATESTATISTICS ?
What is sparse columns of sql server 2008?
What do you mean by subquery?