Skip to content
This repository was archived by the owner on Mar 29, 2026. It is now read-only.
This repository was archived by the owner on Mar 29, 2026. It is now read-only.

T-SQL Offset and Fetch #27

Description

@dazinator

for T-SQL, Offset and Fetch are often used for paging.

Select blah from blah
order by blah
OFFSET((@pageNumber - 1) * @pageSize) ROWS
FETCH NEXT @pageSize ROWS ONLY; 

basically skipping x ROWS and then taking X rows.

Would be nice if this could be supported in the parser - but I understand that this might be t-sql specific.

Never really discussed how best to create database specific variants of SQL generation, but I always assumed you'd have an agnostic model to represent the structure / nature of the sql command, and then the formatter could output the command according to different language variants. That's great for formatting the output, but I am not sure whether there is anything in place for parsing different language variants.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions