v.23.7Improvement

Allow SQL Standard FETCH without OFFSET

Allow SQL standard FETCH without OFFSET. See https://antonz.org/sql-fetch/. #51293 (Alexey Milovidov).
Enable support for SQL standard FETCH clause without requiring OFFSET in ClickHouse queries.

Why it matters

This feature addresses the limitation where FETCH could not be used alone without an OFFSET clause, aligning ClickHouse closer to the SQL standard. It simplifies query writing and improves compatibility with SQL codebases that use FETCH without OFFSET, making ClickHouse easier to use in diverse SQL environments.

How to use it

Users can now write queries with the FETCH clause directly without specifying OFFSET. For example:

SELECT * FROM table_name FETCH FIRST 10 ROWS ONLY

This syntax is supported without requiring an explicit OFFSET clause.