Hello everyone!

How about adding the ability to specify not only integer values ​​for "FETCH { 
FIRST | NEXT } [ count ] { ROW | ROWS } ONLY" and "OFFSET start { ROW | ROWS }" 
and possibly also "LIMIT [ start, ] { count | ALL }" [1], but also expressions, 
for example:
    select * fromPERSON fetch first (10 + 1) rows only;
    select * from PERSON fetch first (10 + ?) rows only;
    select * from PERSON fetch first ((COALESCE(?, 10)) rows only;
 
This is not a part of the standard, but other vendors support such postgresql 
[2], oracle [3], h2 [4] and mssql [5].

Thoughts, suggestions, objections?

[1] - https://calcite.incubator.apache.org/docs/reference.html
[2] - https://www.postgresql.org/docs/18/sql-select.html#SQL-LIMIT
[3] - 
https://docs.oracle.com/en/database/oracle/oracle-database/12.2/sqlrf/SELECT.html
[4] - https://h2database.com/html/commands.html#select
[5] - 
https://learn.microsoft.com/ru-ru/sql/t-sql/queries/select-order-by-clause-transact-sql?view=sql-server-ver17#fetch--first--next---integer_constant--fetch_row_count_expression---row--rows--only

Reply via email to