sql-server - 如何在 SQL Server 中使用和跳过功能
问题描述
SELECT * FROM Table
OFFSET 10 rows
FETCH NEXT 15 rows only;
错误是:“OFFSET”附近的语法不正确。
解决方案
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;
推荐阅读
- java - 我们如何根据 spring-boot 或 java 或 python 中的资源文件中的动态变量检索文本响应
- c - 为什么即使我们通过指针传递它也会导致运行时错误?
- java - Blogger 小部件无法使用我自己的 .js 文件链接
- javascript - 按下空格键后如何禁用文本区域中的退格键?
- angular - 无法加载翻译和所有后备语言,您是否拼错了范围名称?
- flutter - 在flutter应用程序中从显示带有加载小部件的黑屏调用时如何停止setState?
- postgresql - 如何使用标签标记变更集或变更日志文件 - webdevops/liquibase
- grails - 找不到构造函数“java.lang.String”的参数 0
- java - 如何确保 Java 线程永远不会运行无限循环?
- java - 如何在java中按右移?