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

How many types of the database links?

0 Answers   MCN Solutions,


How to populate a table in sql server?

0 Answers  


What are user-defined functions (udfs) in sql server?

0 Answers  


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?

0 Answers  


Do you know what is replace and stuff function in sql server?

0 Answers  






What is row-level compre?

0 Answers  


What do you understand by check constraint in sql server?

0 Answers  


Equi join and non equi join is possible with sql server?

0 Answers  


What is the difference between an index and a unique index?

0 Answers  


What about UPDATESTATISTICS ?

2 Answers   HCL, Intelligroup,


What is sparse columns of sql server 2008?

0 Answers  


What do you mean by subquery?

0 Answers  


Categories