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 you can deploy an ssrs report?
What are indexes in sql?
What is a result set object returned by mssql_query()?
What is the security principal at the server level that represents your session?
What is sleeping status in sql server?
What is single-user mode?
Explain what is the function of sql server agent windows service?
What is 3nf normalization form?
What are the types of lock supported by ?
Can we do dml on views?
What to perform pattern match with the like operator?
How to use column default values in insert statements in ms sql server?
What is the difference between function and stored procedure in sql server?
What are the three different part of rdl file explain them?
How many tables can be joined in SQL Server?