What is the difference between a HAVING CLAUSE and a WHERE
CLAUSE?

Answer Posted / ravindran

1.WHERE clause can be used with SELECT,INSERT and UPADATE statements,where as HAVING clause can only be used with the SELECT statements.

2.WHERE filter after rows before aggregation(GROUPING),
where as,HAVING filters groups,after the aggregations are performed.

3.Aggregate functions cannot be used in the WHERE clause,unless it is in a sub query containing in a HAVING clause,where as,aggregate functions can be used in having clause.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can a table have 2 foreign keys?

500


What are the default system databases in sql server 2000?

536


Can we add an identity column to decimal datatype?

577


What is normalization of database?

599


How to verify a login name with sqlcmd tool?

591






What is a trigger in sql server?

530


Explain sub-query?

567


What is data file in computer?

538


What is 4nf in normalization form?

562


What is in place upgrade in sql server?

520


How is table type constraint applied to a table?

549


What is the difference between insensitive and scroll cursor?

576


What are the different types of Indexes available in SQL Server?

517


What is difference between join and natural join?

477


Explain user defined views?

573