Oracle PL/SQL Tutorial/Analytical Functions/MODEL — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Версия 16:45, 26 мая 2010
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
<source lang="sql">
<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> ... )</source>