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;
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