Skip to content

T-SQL Offset and Fetch #27

@dazinator

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.

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