adspace


Why we need a group by clause?

Answer Posted / vampire007

We use GroupBy clause to analyze data in table,by means of
various sql server aggregate functions like SUM(), AVERAGE
() etc., according to some domain.

For eg., If we want to know the sales done by a every
employee, then we would use somewhat this kind of query:

/**
select employeeid, count(*)
from orders
groupby employeeid
order by employeeid
**/

Is This Answer Correct ?    7 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

List the ways in which dynamic sql can be executed?

1094


What is the difference between for xml raw and for xml auto?

1125


Where can you add custom error messages to sql server?

1220


How efficient you are in oracle and SQL server?

1269


What are the pros and cons of putting a scalar function in a queries select list or in the where clause?

1303


Can we do dml on views?

1041


How to provide default values to function parameters?

1272


How to convert character strings into numeric values?

1196


Why use identity in sql server?

1209


List out the different types of locks available in sql server?

1055


What is sql server query analyzer?

1136


What are different types of constraints?

1007


What are the source of constraints?

1015


How can I check that whether automatic statistic update is enabled or not?

1120


How to convert numeric expression data types using the cast() function?

1157