Why we need a group by clause?

Answers were Sorted based on User's Feedback



Why we need a group by clause?..

Answer / sd

While using aggregate functions.

Is This Answer Correct ?    7 Yes 1 No

Why we need a group by clause?..

Answer / 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

Why we need a group by clause?..

Answer / satyanarayana

In order to provide a condition to the select statement
either by group by column or aggregate function

Is This Answer Correct ?    1 Yes 0 No

Why we need a group by clause?..

Answer / ricky

while we are using a aggregate function we use the group by
clause....

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More SQL Server Interview Questions

How to achieve Paging of records in SQL SERVER?

0 Answers   Petranics Solutions,


how can you find out if the current user is a member of the specified microsoft® windows nt® group or microsoft sql server™ role? : Sql server administration

0 Answers  


how to determine the service pack currently installed on sql server? : Sql server database administration

0 Answers  


When you use @@error and try-catch?

0 Answers  


How to find the date and time of last updated table?

3 Answers  






How to create user messages with print statements in ms sql server?

0 Answers  


How to perform backup for certificates in sql server? : sql server security

0 Answers  


What is difference between restoration and recovery in SQLServer?

3 Answers   Microsoft,


what is create database syntax? : Sql server database administration

0 Answers  


What are three ways you can use an identity value inside a trigger? Why would you prefer one way over another?

0 Answers  


I applied Transactional with updatable subscriptions replication on 2 tables now i want to delete those 2 tables but i cannot delete those tables as replication is running how can i stop replication for those 2 tables(but i don't want to delete those replicated tables but i need to stop the replication) how can i do that

0 Answers  


What is CTE in SQL

0 Answers   Infosys,


Categories