What is the difference between having and where clause?

Answers were Sorted based on User's Feedback



What is the difference between having and where clause?..

Answer / thirumal reddy

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

What is the difference between having and where clause?..

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

What is the difference between having and where clause?..

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

What is the difference between having and where clause?..

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

Post New Answer

More SQL Server Interview Questions

What are clustered and non-clustered index?

0 Answers  


What are the differences between stored procedure and the dynamic sql?

0 Answers  


What is the difference between migration and upgradation in sql server?

0 Answers  


What is the process of indexing?

0 Answers  


Where the sql logs gets stored?

0 Answers  






What is a trigger and types of a trigger?

0 Answers  


What is data source document?

0 Answers  


What is difference between commit and rollback when used in transactions?

0 Answers  


4 Please write a querry to find repeated numbers in the following table. Table Name: Table1 Field1 10 15 20 15 10

7 Answers  


What do you mean by authentication modes in sql server?

0 Answers  


Explain what you mean by 3 tier architecture.

0 Answers   TCS,


What are the new features in SQL Server 2005 when compared to SQL Server 2000?

0 Answers  


Categories