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

Kim Haase commented on DERBY-4079:
----------------------------------

The draft docs look very good. A few questions and minor language corrections --


SELECT statement (rrefsqlj41360.html):

Should you add a mention of the two new clauses to the first sentence? It still 
mentions only ORDER BY and FOR UPDATE.

Also, I am wondering if the syntax should put square brackets around

  WITH {RR|RS|CS|UR}

since this part is also optional? (There should in theory be a separate issue 
filed for this, but it might never get fixed ...)

In the sentence about the two new clauses, there should be no "s" after the 
second one. That is, it should say "The result offset clause and the fetch 
first clause can be used ..."

The sentence "The SELECT statement supports the FOR FETCH ONLY clause." is 
confusing to me because the syntax in the rrefsqljoffsetfetch.html topic 
doesn't include FOR. Should it?


rrefsqljoffsetfetch.html:

Title should be "The result offset and fetch first clauses".

In the 3rd sentence, change "usually combined also with" to "usually in 
combination with".

I don't think you need quite so much vertical space around the clauses in the 
Syntax section.

Change 

  "The use of ROW or ROWS and FIRST or NEXT are equivalent." 

to 

  "The use of ROW or ROWS and the use of FIRST or NEXT are equivalent."

I expect you'll be adding some examples to either this topic or the SELECT 
statement topic or both?

If you decide to add anything on this subject to the tuning guide topic on 
materialization, you could presumably reference it here.


> Add support for SQL:2008 <result offset clause> and <fetch first clause> to 
> limit result set cardinality
> --------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-4079
>                 URL: https://issues.apache.org/jira/browse/DERBY-4079
>             Project: Derby
>          Issue Type: New Feature
>          Components: SQL
>            Reporter: Dag H. Wanvik
>            Assignee: Dag H. Wanvik
>         Attachments: ref.zip
>
>
> SQL 2008 has added new syntax to support a direct way to limit the
> returned set of rows in a result set.  This allows an application to
> retrieve only some rows of an otherwise larger result set, similar to
> the popular LIMIT clauses use in some databases.
> Up till now, in Derby (and SQL) we have had to use the ROW_NUMBER()
> function in a nested subquery to achieve the effect of the <fetch
> first clause>, cf. DERBY-2998, a method which is rather more indirect
> and still not efficient (DERBY-3505), and primarily intended for OLAP
> functionality, perhaps.
> There has been no direct way to achieve the effect of the <result
> offset clause> via SQL.
> Syntax (cf. SQL 2008, section 7.13):
>        <result offset clause> ::= OFFSET <n> {ROW | ROWS}
>        <fetch first clause> ::=      FETCH {FIRST | NEXT} [<n>] {ROW | ROWS} 
> ONLY
> where <n> is an integer. The two clauses syntactically follow the ORDER BY
> clause in the grammar.
> Note that both ORDER BY and the new clauses above are allowed also in
> subqueries in the new version of the SQL standard (section 7.13). I
> only propose to include this at the top level in DERBY for now. (ORDER
> BY is presently also not allowed in subqueries in Derby since SQL
> didn't allow for this until SQL 2008 either).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to