Flo*_*Flo 4 t-sql sql-server pagination sql-order-by
运行此语句时出现错误 Windowed functions and NEXT VALUE FOR functions do not support constants as ORDER BY clause expressions.
SELECT * FROM (select ROW_NUMBER() OVER (ORDER BY 'publishdate DESC') as RowNum,
* FROM news WHERE publishdate <=getdate()) as info
WHERE RowNum > 0 AND RowNum <= (100)
Run Code Online (Sandbox Code Playgroud)
我想使用此语句在分页网格视图中检索结果集。
如何让这个语句运行?
SELECT * FROM (select ROW_NUMBER() OVER (ORDER BY publishdate DESC) as RowNum,
* FROM news WHERE publishdate <=getdate()) as info
WHERE RowNum > 0 AND RowNum <= (100)
Run Code Online (Sandbox Code Playgroud)
您不需要'in (ORDER BY publishdate DESC)
| 归档时间: |
|
| 查看次数: |
6746 次 |
| 最近记录: |