[ 
https://issues.apache.org/jira/browse/DERBY-6103?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13617157#comment-13617157
 ] 

Dag H. Wanvik commented on DERBY-6103:
--------------------------------------

That is correct. Currently, we do not allow any other <window specification> 
than ( ), but hopefulyl we will in the future.

But we do allows the window to be specified in two locations, either 1) inline, 
corresponding the the first production above ("ROW_NUMBER() OVER ()") , or 2) 
as part of WINDOW clause shows with the selectExpression above (needs adding).

The derivation for the other example "ROW_NUMBER() OVER window_name" is 

   <window function> -> <window function type> OVER <window name or 
specification>
 
   <window function type> -> ROW_NUMBER OVER <left paren> <right paren> -> 
ROW_NUMBER (), 

giving

   ROW_NUMBER () OVER <window name or specification>

then 

   <window name or specification> -> <window name>

giving 

   ROW_NUMBER () OVER <window name>

In this case, there is no window specification involved, so the <window name> 
must refer to a <window name> introduced by a WINDOW clause. Note that WINDOW 
clause is *not* part of the <window function>'s syntax but rather part of the 
syntax for <selectExpression>. Hope this helps :)
 


                
> Improve documentation of ROW_NUMBER function
> --------------------------------------------
>
>                 Key: DERBY-6103
>                 URL: https://issues.apache.org/jira/browse/DERBY-6103
>             Project: Derby
>          Issue Type: Improvement
>          Components: Documentation
>    Affects Versions: 10.10.1.1
>            Reporter: Dag H. Wanvik
>            Assignee: Kim Haase
>            Priority: Minor
>         Attachments: DERBY-6103.diff, DERBY-6103.stat, DERBY-6103.zip
>
>
> The current documentation doesn't mention that we allow the window definition 
> to be explicit.
> The restriction on WHERE clause no longer applies, nor does the sentence 
> about ORDER BY not being allowed in subqueries. Cf. rreffuncrownumber.dita. 
> Also, the documentation mentions that we don't support LIMIT, but not that we 
> now support the FETCH/OFFSET clause, which is often a better option than 
> ROW_NUMBER.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to