Class SQLServer2012LimitHandler

All Implemented Interfaces:
LimitHandler

@SPI public final class SQLServer2012LimitHandler extends OffsetFetchLimitHandler
A LimitHandler compatible with SQL Server 2012 which introduced support for the ANSI SQL standard syntax OFFSET m ROWS FETCH NEXT n ROWS ONLY, though this syntax is considered part of the ORDER BY clause, and with the wrinkle that both ORDER BY and the OFFSET clause are required.
Since:
8.0
  • Field Details

  • Method Details

    • begin

      protected void begin(String sql, StringBuilder offsetFetch, boolean hasFirstRow, boolean hasMaxRows)
      OFFSET and FETCH have to come right at the end of the ORDER BY clause, and OFFSET is required in order to have a FETCH:
      order by ... offset m rows [fetch next n rows only]
      Overrides:
      begin in class OffsetFetchLimitHandler