Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

How to insert multiple rows with a subquery?

1190


Sql server reporting services vs. Crystal reports.

140


Define Unique Key?

1066


What is the difference between SQL notification and SQL invalidation?

1265


Mention the differences between sql server and mysql.

1086


How to verify a login name with sqlcmd tool?

1266


What are the database objects? : SQL Server Architecture

1098


What is a non-clustered index?

1045


How do I start sql server 2016?

952


How to generate create table script on an existing table in ms sql server?

1196


What is normalization? What number of normalization shapes are there?

1159


What is the difference between cartesian product and cross join?

904


How many types of cursor type are there?

1167


Define cross join in sql server joins?

1080


What stored by the model?

1139