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
How to insert multiple rows with a subquery?
Sql server reporting services vs. Crystal reports.
Define Unique Key?
What is the difference between SQL notification and SQL invalidation?
Mention the differences between sql server and mysql.
How to verify a login name with sqlcmd tool?
What are the database objects? : SQL Server Architecture
What is a non-clustered index?
How do I start sql server 2016?
How to generate create table script on an existing table in ms sql server?
What is normalization? What number of normalization shapes are there?
What is the difference between cartesian product and cross join?
How many types of cursor type are there?
Define cross join in sql server joins?
What stored by the model?