label-match-recognize-introduction-displaying-information-
about-the-match) .
In general, when a window function is used inside a ` MATCH_RECOGNIZE  `
clause, the window function does not require its own ` OVER  (PARTITION  BY
...  ORDER  BY  ...)  ` clause. The window is implicitly determined by the `
PARTITION  BY  ` and ` ORDER  BY  ` of the ` MATCH_RECOGNIZE  ` clause.
(However, see  Limitations on Window Functions used in DEFINE and MEASURES
for some exceptions.)
frames) is also derived implicitly from the current context in which the
window function is being used. The lower bound of the frame is defined as
described below:
> In the ` DEFINE  ` subclause:
>
>> The frame starts at the beginning of the current matching attempt except
when using ` LAG  ` , ` LEAD  ` , ` FIRST_VALUE  ` , and ` LAST_VALUE  ` .
>
> In the ` MEASURES  ` subclause:
>
>> The frame starts at the beginning of the match that was found.
The edges of the window frame can be specified by using either ` RUNNING  ` or
` FINAL  ` semantics.
>
>     expr ::= ... [ { RUNNING | FINAL } ] windowFunction ...
>  
>
> Copy
>
> ` RUNNING  ` :
>
>> In general, the frame ends at the current row. However, the following
exceptions exist:
>>
>>   * In the ` DEFINE  ` subclause, for ` LAG  ` , ` LEAD  ` , ` FIRST_VALUE
` , ` LAST_VALUE  ` , and ` NEXT  ` , the frame ends at the last row of the
window.
>>
>>   * In the ` MEASURES  ` subclause, for ` PREV  ` , ` NEXT  ` , ` LAG  ` ,
and ` LEAD  ` , the frame ends at the last row of the window.
>>
>>
>>
>> In the ` DEFINE  ` subclause, ` RUNNING  ` is the default (and the only
allowed) semantic.
>>
>> In the ` MEASURES  ` subclause, when the ` ALL  ROWS  PER  MATCH  `
subclause is used, ` RUNNING  ` is the default.
>
> ` FINAL  ` :
>
>> The frame ends at the last row of the match.
>>
>> ` FINAL  ` is allowed only in the ` MEASURES  ` subclause. It is the
default there when ` ONE  ROW  PER  MATCH  ` applies.
Symbol Predicates  :
Expressions within the ` DEFINE  ` and ` MEASURES  ` subclauses allow symbols
as predicates for column references.
    predicatedColumnReference ::= <symbol>.<column>
Copy
The ` <symbol> ` indicates a row that was matched, and the ` <column> `
identifies a specific column within that row.
A predicated column reference means that the surrounding window function only
looks at rows that were finally mapped to the specified symbol.
> Predicated column references can be used outside and inside of a window
> function. If used outside of a window function, ` _ <symbol>.<column> _ ` is
> the same as ` LAST(<symbol>.<column>)  ` . Inside of a window function, all
> column references either need to be predicated with the same symbol or are
> all non-predicated.
The following explains how navigational-related functions behave with
predicated column references:
  * ` _ PREV/LAG(  ...  <symbol>.<column> ...  ,  <offset>)  _ ` Searches the window frame backwards starting from and including the current row (or last row in case of a ` FINAL  ` semantic) for the first row that was finally mapped to the specified ` <symbol> ` , and then goes ` <offset> ` (default is 1) rows backwards, ignoring the symbol those rows were mapped to. If the searched part of the frame does not contain a row mapped to ` <symbol> ` or the search would go beyond the edge of the frame, then NULL is returned. 
  * ` _ NEXT/LEAD(  ...  <symbol>.<column> ...  ,  <offset>)  _ ` Searches the window frame backwards starting from and including the current row (or last row in case of a ` FINAL  ` semantic) for the first row that was finally mapped to the specified ` <symbol> ` , and then goes ` <offset> ` (default is 1) rows forward, ignoring the symbol those rows were mapped to. If the searched part of the frame does not contain a row mapped to ` <symbol> ` or the search would go beyond the edge of the frame, then NULL is returned. 
  * ` _ FIRST/FIRST_VALUE(  ...  <symbol>.<column> ...  )  _ ` Searches the window frame forwards starting from and i