What is the difference between HAVING clause and the WHERE
clause?
Answer Posted / mayursinh zala
'Where' clause applies to the individual rows whereas 'Having' clause is used to test some condition on the group(usually aggregate methods) rather than on individual rows.
Specifies a search condition for a group or an aggregate. HAVING can be used only with the SELECT statement. HAVING is typically used in a GROUP BY clause. When GROUP BY is not used, HAVING behaves like a WHERE clause.
So you can use having WITHOUT group by clause. This is a sample, although it might make no sense of business value:
select max(state) from States having count(State) > 60
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How the authentication mode can be changed?
Explain the use of containers in ssis?
Can we run Reporting Services with SQL Server express edition, which is a free version of SQL Server?
Do you know what is replace and stuff function in sql server?
What is subquery explain with example?
How can we call UDF(User Define Function) using C# code in ASP.net ?
What is transaction server explicit transaction?
What are various ways to enhance the ssrs report?
How to configure and test odbc dsn settings?
Explain what are various ways to enhance the ssrs report?
What is db stored procedure?
How to assign null values to variables or columns?
What options are available to audit login activity? : sql server security
What is snapshot parameter in ssrs?
Explain about service Broker functions?