Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Semestr2 / 1 - Oracle / 5-Aggregating.ppt
Скачиваний:
16
Добавлен:
12.05.2015
Размер:
164.35 Кб
Скачать

Nestingi Group Functionsi

Display the maximum average salary.

SQL>

SELECT

max(avg(sal))

2

FROM

emp

3GROUP BY deptno;

MAX(AVG(SAL))

-------------

2916.6667

5-24

 

 

Summary

 

 

 

 

 

SELECT

column, group_function (column)

 

 

FROM

table

 

 

[WHERE

condition]

 

 

[GROUP BY

group_by_expression]

 

 

[HAVING

group_condition]

 

 

[ORDER BY

column];

 

 

 

 

 

 

 

 

 

Order of evaluation of the clauses:

WHERE clausel

GROUP BY clausel

HAVINGI clausel

5-25

Practicei Overviewi

Showing different queries that use group functions

Showing different queries that use group functions

Grouping by rows to achieve more than one result

Grouping by rows to achieve more than one result

Excluding groups by using the HAVING clause

Excluding groups by using the HAVING clause

5-26

Соседние файлы в папке 1 - Oracle