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

Kim Haase commented on DERBY-4518:
----------------------------------

Thanks very much, Dag, I'm starting on these. 

After some experimenting I am finding that I get a syntax error when I use the 
offset clause in a VALUES expression, although the order by and fetch first 
clauses work fine. Is this expected?

ij> values (3,21),(1,22),(2,23);
1          |2          
-----------------------
3          |21         
1          |22         
2          |23         

3 rows selected
ij> values (3,21),(1,22),(2,23) order by 1;
1          |2          
-----------------------
1          |22         
2          |23         
3          |21         

3 rows selected
ij> values (3,21),(1,22),(2,23) order by 2;
1          |2          
-----------------------
3          |21         
1          |22         
2          |23         

3 rows selected
ij> values (3,21),(1,22),(2,23) fetch first 2 rows only;
1          |2          
-----------------------
3          |21         
1          |22         

2 rows selected
ij> values (3,21),(1,22),(2,23) order by 1 fetch first 2 rows only;
1          |2          
-----------------------
1          |22         
2          |23         

2 rows selected
ij> values (3,21),(1,22),(2,23) order by 1 offset 2;
ERROR 42X01: Syntax error: Encountered "<EOF>" at line 1, column 47.
Issue the 'help' command for general information on IJ command syntax.
Any unrecognized commands are treated as potential SQL commands and executed 
directly.
Consult your DBMS server reference documentation for details of the SQL syntax 
supported by your server.


> Document ORDER BY and OFFSET/FETCH in subqueries
> ------------------------------------------------
>
>                 Key: DERBY-4518
>                 URL: https://issues.apache.org/jira/browse/DERBY-4518
>             Project: Derby
>          Issue Type: Improvement
>          Components: Documentation
>            Reporter: Dag H. Wanvik
>            Assignee: Kim Haase
>
> DERBY-4397 and DERBY-4398 extends the usability of ORDER BY and OFFSET/FETCH 
> to subqueries and view. This should be documented.

-- 
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