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

Julian Hyde commented on CALCITE-1786:
--------------------------------------

I know that ROWNUM can be used to implement FETCH but I'm not so sure about 
OFFSET. Does the query you posted actually work?

Anyway, happy to accept this feature if it comes with appropriate tests.

> Implement Oracle <12g support of limit/offset query syntax
> ----------------------------------------------------------
>
>                 Key: CALCITE-1786
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1786
>             Project: Calcite
>          Issue Type: Task
>    Affects Versions: 1.11.0
>            Reporter: Sergiy Simonov
>            Assignee: Julian Hyde
>             Fix For: next
>
>
> Currently Calcite supports only two kinds of limit/offset SQL query syntax:
> If in DB dialect supportsOffsetFetch == false, syntax is
> {code}LIMIT 20 OFFSET 10{code}
> If supportsOffsetFetch == true, syntax is
> {code}OFFSET 10 ROWS FETCH NEXT 20 ROWS ONLY{code}
> Oracle dialect uses the later syntax and it works perfectly fine for Oracle 
> 12g
> But Oracle before 12g version does not support this syntax, as well as 
> LIMIT/OFFSET syntax.
> Oracle query for older Oracle version should look like:
> {code}
> SELECT * FROM (original query)
> WHERE ROWNUM > 10 AND ROWNUM <= 20
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to