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
Name few endpoints exposed by ssrs 2012?
Can an entity have two primary keys?
What is set nocount on?
Can we install sql server 2016 on windows 7?
What are rows and columns?
What is a trigger? Why we need it?
What is the filtered index?
How can you list all the table constraints in a database?
What are acid properties of transaction?
What is the usage of the sign function?
How to find the second highest salary of an employee?
What are some examples of schemas?
What are drillthrough reports?
What is the difference between seek predicate and predicate?
How to download and install microsoft sql server management studio express?