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 |
What is the recovery model?
What is the difference between osql and query analyzer?
Write an SQL query to obtain the 2nd highest salary.
0 Answers Akamai Technologies,
Define master database?
Why should we go for stored procedures? Why not direct queries?
Hi..here i would like to know the Backup and Restore models?
What is the language structure to add a record to a table?
What is a trace frag?
What is inner join? Explain with an example?
What is the use of commit?
What are actions, how many types of actions are there, explain with example? : sql server analysis services, ssas
Explain what is the purpose of sql profiler in sql server?