Do you have a comment or suggestion to improve SQL Server? We’d love to hear it!

SELECT - ORDER BY (OFFSET, FETCH) clause is missing optional parentheses in documentation

See https://docs.microsoft.com/en-us/sql/t-sql/queries/select-order-by-clause-transact-sql?view=sql-server-2017

OFFSET and FETCH are missing optional '( )', when expression is specified

I think it should be like this

OFFSET [(] { integer_constant | offset_row_count_expression } [)] { ROW | ROWS }
[
FETCH { FIRST | NEXT } [(] {integer_constant | fetch_row_count_expression } [)] { ROW | ROWS } ONLY
]

This is valid statement

SELECT *
FROM HumanResources.Employee e
ORDER BY
e.OrganizationNode
OFFSET (0) ROWS
FETCH FIRST (1) ROWS ONLY

1 vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    Vladimir Moldovanenko shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    1 comment

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)
      Submitting...

      Feedback and Knowledge Base