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

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

Actually, the sentence is still correct. The syntax should be improved a bit 
though:

ROW_NUMBER() OVER ()

ROW_NUMBER() OVER window_name WINDOW window_name AS ()

=> 

<window function> ::=
     <window function type> OVER <window name or specification>

<window function type> ::=
     ROW_NUMBER <left paren> <right paren>

<window name or specification> ::=
    <window name>
  | <window specification>

<window specification> ::=
    <left paren> <right paren>


<window-name> ::= sql92Identifier


and also in the selectExpression section (rrefselectexpression.html) we should 
insert:

SELECT [ DISTINCT | ALL ] SelectItem [ , SelectItem ]*
FROM clause
[ WHERE clause ]
[ GROUP BY clause ]
[ HAVING clause ]
[ WINDOW clause ]     <-------------------
[ ORDER BY clause ]
[ result offset clause ]
[ fetch first clause ]

and add

<window clause> ::=
    WINDOW <window-name> <window specification>

Not sure how many sections to make/spread these over....  maybe it
would be good to have a section for <window specification>,
which could be referenced by both the ROW_NUMBER section an the 
selectExpression section.

This is all a bit premature really, since we don't allow anything except the 
empty specification yet, but if we get it right now I should be easy to extend 
later.

                
> 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