Oracle PL/SQL Tutorial/Analytical Functions/MODEL

Материал из SQL эксперт
Версия от 10:06, 26 мая 2010; Admin (обсуждение | вклад) (1 версия)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

The MODEL statement does calculations on a column in a row based on other rows in a result set.

The MODEL or SPREADSHEET clause is very much like treating the result set of a query as a multidimensional array.

The keywords MODEL and SPREADSHEET are synonymous.

The MODEL or SPREADSHEET clause allows us to compute a row in the result set that can retrieve data on some other row(s) without explicitly defining a virtual table.

The overall syntax for the MODEL or SPREADSHEET SQL statement



<prior clauses of SELECT statement>
MODEL [main]
[reference models]
[PARTITION BY (<cols>)]
DIMENSION BY (<cols>)
MEASURES (<cols>)
[IGNORE NAV] | [KEEP NAV]
[RULES
[UPSERT | UPDATE]
[AUTOMATIC ORDER | SEQUENTIAL ORDER]
[ITERATE (n) [UNTIL <condition>] ]
( <cell_assignment> = <expression> ... )