-
Notifications
You must be signed in to change notification settings - Fork 5
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Description
Add support for SQL:2008 standard pagination syntax as alternative to LIMIT/OFFSET.
Example SQL
-- FETCH FIRST
SELECT * FROM users ORDER BY id FETCH FIRST 10 ROWS ONLY;
SELECT * FROM products FETCH FIRST 5 ROW ONLY;
-- With OFFSET
SELECT * FROM users ORDER BY id OFFSET 20 ROWS FETCH NEXT 10 ROWS ONLY;
-- Percentage
SELECT * FROM users FETCH FIRST 10 PERCENT ROWS ONLY;
-- WITH TIES
SELECT * FROM products ORDER BY price FETCH FIRST 5 ROWS WITH TIES;Current Behavior
LIMIT/OFFSET works but SQL standard FETCH FIRST syntax is not supported.
Expected Behavior
Parser should recognize FETCH FIRST/NEXT and OFFSET ROWS as pagination clauses.
Priority
Medium - SQL standard compliance
Implementation Notes
- Add tokens:
FETCH,FIRST,NEXT,ROWS,ROW,ONLY,TIES,PERCENT - Add
FetchClauseto SelectStatement AST - Support WITH TIES for including ties in ordered results
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request