现在的位置: 网页制作教程网站制作教程 >正文
SQL语句教程

sql语句查询第4条到第7条记录

发表于2016/12/19 网站制作教程 0条评论 ⁄ 热度 2,952℃

经过排序后,SQL语句查询第4条到第7条记录,或者叫做不包含前3条的前4条记录。

用sql语句中的not in 实现。下面是对应sql语句:

select top 4 * from table where Id not in (select top 3 Id from table order by Id desc) order by Id desc
  • 暂无评论