首页 > 解决方案 > 如何在 SQL Server 中使用和跳过功能

问题描述

SELECT * FROM Table
OFFSET 10 rows           
FETCH NEXT 15 rows only;

错误是:“OFFSET”附近的语法不正确。

标签: sql-server

解决方案


you can read this article https://www.sqlservertutorial.net/sql-server-basics/sql-server-offset-fetch/

and by the way your select missing an order by for example like this

    SELECT
product_name,
list_price FROM production.products ORDER BY    list_price,    product_name  OFFSET 10 ROWS;

推荐阅读