查询第几条到第几条的数据的SQL语句

查询第几条到第几条的数据的SQL语句

select top N * from (select top M * from table_name order by id desc) table_name order by table_name.id desc
M指的是表中前面M条数据;
N指的是表后几条的数据;
这样就可以成为查询第10条

posted @ 2012-01-09 22:56  沐雪架构师  阅读(471)  评论(0编辑  收藏  举报