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 are clustered and non-clustered index?
What are the differences between stored procedure and the dynamic sql?
What is the difference between migration and upgradation in sql server?
What is the process of indexing?
Where the sql logs gets stored?
What is a trigger and types of a trigger?
What is data source document?
What is difference between commit and rollback when used in transactions?
4 Please write a querry to find repeated numbers in the following table. Table Name: Table1 Field1 10 15 20 15 10
What do you mean by authentication modes in sql server?
Explain what you mean by 3 tier architecture.
What are the new features in SQL Server 2005 when compared to SQL Server 2000?