Friday, August 2, 2019

What is the use of the group by clause?

GROUP BY clause is a SQL command that is used to group rows that have the same values.

The GROUP BY clause is used in the SELECT statement .

The GROUP BY clause is used in a SELECT statement to group rows into a set of summary rows by values of columns or expressions.

The GROUP BY clause returns one row per group.

The GROUP BY clause is often used with aggregate functions such as AVG() , COUNT() , MAX() , MIN() and SUM() .

Without GROUP BY we can not use HAVING Clause

Example:

SELECT COUNT(*),DEPTNO FROM EMP GROUP BY DEPTNO HAVING COUNT(*)>3;

No comments:

Post a Comment

AME (Approval Management Engine)

AME (Approval Management Engine) : AME Stands for Oracle Approval Management Engine. AME is a self service web application that enables...