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

How to call a function from a stored procedure in SQL Server ?

553


Explain what are sparse columns?

570


What number sorts of privileges are accessible in sql?

600


What are the different types of upgrades that can be performed in sql server?

691


What is Federation Root Database?

90






What are the different types of data sources in ssrs?

142


what is blocking? : Sql server database administration

504


What is linked report?

89


When is update_statistics command used?

587


What is normalization? Explain its different types?

604


What is BCP? When does it used in sql server 2012?

578


What are system databases into sql server (2005/2008) : sql server database administration

572


Can anyone tell that the extra features are there in SQL SERVER 2008 that are not available in previous versions .

1489


Can we shrink data file in sql server?

539


How to create a Master database in SQL server ?

551