sqlserver分页出错

qq_33747342 2016-07-11 01:31:42
select * from (select *,ROW_NUMBER()over(order by ID desc) as num from DATA_COLLECTT) as t where num between >3 and <=6

把>和<=去掉有就好了 不报错, 但是我想加> 3 and <=6怎么写
...全文
89 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
Ginnnnnnnn 2016-07-11
  • 打赏
  • 举报
回复
select * from (select *,ROW_NUMBER()over(order by ID desc) as num from DATA_COLLECTT) as t where num >3 and num <=6
卖水果的net 2016-07-11
  • 打赏
  • 举报
回复
where num between 3 and 6 与 下面等价 where num >= 3 and num <=6 如果你是 where num >3 and num <= 6 就不能写成 between 形式,between 包含了两个值本身;

27,579

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 应用实例
社区管理员
  • 应用实例社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧