You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Dag H. Wanvik (JIRA)" <ji...@apache.org> on 2009/04/27 23:20:30 UTC

[jira] Commented: (DERBY-4192) OFFSET and FETCH FIRST documentation improvement

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

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

Thanks for this improvement, Tiago. +1

This sentence could be misconstrued though;

-- It will fetch rows 11 through 20 (inclusive) from the table T, sorted by I 

The sorting happen *before* the row count filtering, so I think it would be better to say:

-- The statement will order T by I, and then fetch rows 11 through 20 (inclusive) of the sorted rows.

In general, just returning a subset of the rows *without* ordering is not portable, unless the app
does not care which rows go into the subset.





> OFFSET and FETCH FIRST documentation improvement
> ------------------------------------------------
>
>                 Key: DERBY-4192
>                 URL: https://issues.apache.org/jira/browse/DERBY-4192
>             Project: Derby
>          Issue Type: Improvement
>    Affects Versions: 10.5.1.1
>            Reporter: Tiago R. Espinha
>            Priority: Minor
>
> I have a suggestion regarding the documentation for the OFFSET and FETCH FIRST documentation. On these documents, we have three SQL examples on the usage of these clauses. I suggest that we add a brief description of what each clause does.
> This might help the users to have a better understanding at first of how the said clauses work.
> Here are the examples with a possible description:
> -- This query fetches the first row from T
> SELECT * FROM T FETCH FIRST ROW ONLY;
> -- This query skips the first 10 rows and fetches the following 10.
> -- It will fetch rows 11 through 20 (inclusive) from the table T, sorted by I
> SELECT * FROM T ORDER BY I OFFSET 10 ROWS FETCH NEXT 10 ROWS ONLY;
> -- This query skips the first 100 rows from T.
> -- If the table has less than 101 records, then an empty result set is returned.
> SELECT * FROM T OFFSET 100 ROWS;

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