0 ORDER by Asc/desc default ascending
Order BY Column name | expression | alias | serial number
Put the space behind: ORDER by Desc nulls last
1 grouping function--Automatically filters null values
Count (*|distinct|clumn) Max min sum avg
Select SUM (COMM)/count (*) One,
SUM (comm)/count (comm) two, AVG (COMM) three from EMP
2 filter resolution, NULL replacement function, NVL (comm,0)
1 Select COUNT (*), COUNT (comm)
From EMP
2 Select COUNT (*), COUNT (NVL (comm,0))
From EMP
3 grouping;
Statistic average salary by department, different positions
Select Deptno,job,avg (SAL) from the EMP group by DEPTNO;
Error above
**oracle all the group by statements that should be included in the groups function should be included
4 Where and having
If both where and having can apply to group, it is preferable to ====where
If the condition contains a group function, you must apply the having
5 Enhancements to Group by
Report-Related structures
GROUP BY Deptno,job +
GROUP BY Deptno +
GROUP BY NULL
=====
GROUP BY rollup (Deptno,job)
General wording: GROUP by rollup (A, b);
-----------------------------------
6 segment:
Break on Deptno Skip 2
Break on NULL elimination
Select Deptno,job,avg (SAL)
From EMP
GROUP BY rollup (deptno,job) Order by Deptno
/
Oracle Learning third-multi-line functions