what is the difference between group and having
give an example with query and sample output
Answer Posted / manub22
- GROUP BY clause works on the rows returned by a SELECT Query. This clause summaries identical rows into a single/distinct group and returns a single row with the summary for each group, by using appropriate Aggregate function in the SELECT list, like COUNT(), SUM(), MIN(), MAX(), AVG(), etc.
- HAVING clause works as a Filter on top of the Grouped rows returned by the Query containing the GROUP BY clause. This clause cannot be replaced by a WHERE clause and vice-versa.
Check the difference b/w GROUP BY & HAVING, link: http://sqlwithmanoj.com/2015/05/23/sql-basics-difference-between-where-group-by-and-having-clause/
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Mention the different authentication modes in sql server.
How to change parameter value inside the report?
How to stop log file growing too big?
Where views are stored in sql server?
How to enable tcp/ip protocol on a sql server?
What is a linked server in sql server?
What area unit the various kinds of info compression introduced in sql server 2008?
Suppose you want to implement the many-to-many relationships while designing tables. How would you do it?
What is the dbcc command and why is it used?
How to include date and time values in sql statements?
How to use order by with union operators in ms sql server?
Does the unique constraint create an index?
What is normalization 1nf 2nf 3nf?
What are the instances when triggers are appropriate?
How to declare a cursor with "declare ... Cursor" in ms sql server?