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

What happens when converting big values to integers?

1000


What is store procedure? When do you use?

937


Explain system functions or built-in functions? What are different types of system functions?

984


When do you think a developer should use sql server-based cursors?

1052


how to take backup bcp out for a column in table in sql server?

2105


between cast and convert which function would you prefer and why?

957


Does full backup break log chain?

970


Explain the various types of concurrency problem. I.e. Lost or buried updates, uncommitted dependency, inconsistent analysis, phantom read?

953


What is an expression in ms sql server?

1080


can an order by clause be used in a creation of a view?

1183


What are the types of indexing?

1084


What are the different types of collation sensitivity?

1129


Write an sql query to find first weekday of the month?

921


Can we join two tables without primary key?

1057


what is a join and explain different types of joins? : Sql server database administration

962