Max min avg count sum
1, the entire result set is a group
1 to the Department 30 of the highest wages, minimum wage, average wage, total number of people who have work, the number of jobs and the sum of Wages copy code code as follows:
Select Max (ename), Max (SAL),
Min (ename), Min (Sal),
AVG (SAL),
Count (*), COUNT (Job), COUNT (Distinct (job)),
Sum (SAL) from EMP where deptno=30;
2, grouping with group by and having
1 According to the Department of the highest wages, minimum wage, the total number of people have work, the number of jobs and the total wage copy code is as follows:
Select Deptno, Max (ename), Max (SAL),
Min (ename), Min (Sal),
AVG (SAL),
Count (*), COUNT (Job), COUNT (Distinct (job)),
Sum (SAL) from the EMP group by DEPTNO;
  &NBSP
2) Department 30 of the highest wages, minimum wage, total number, number of work, number of jobs and wages combined copy code code as follows:
Select Deptno, max (ename), Max (SAL),
min (ename), Min (sal),
& nbsp; avg (SAL),
Count (*), COUNT (Job), COUNT (Distinct (Job)),
SUM (SAL) from the EMP group by Deptno has deptno=30;
  &NBSP
3, StdDev returns the standard deviation of a set of values
select Deptno,stddev (SAL) from EMP Group by DEPTNO;
Variance Returns the variance difference for a set of values
select Deptno,variance (SAL) from EMP Group by deptno;
4, GROUP by
with rollup and cube operators Rollup statistics by the first column in the group and the last subtotal
cube Statistics by all columns grouped and final subtotal
select Deptno,job, sum (SAL) from EMP Group by Deptno,job;
& nbsp Select Deptno,job, sum (SAL) from EMP Group by Rollup (deptno,job);
Cube produces statistics and final subtotals for all columns in a group
Select Deptno,job, sum (SAL) from the EMP Group by Cube (Deptno,job);