1、select to 40 * from tablename where Not In(select to 30 * FROM tablename)
2、select to 40 * from Not In(select to 30 * FROM tablename)
这两条行不行?我用的是mysql,sql server,好像rownum不能用吧,不知有没有更简单的写法? SQL Server 2005中可以使用row_number()函数,但结果是经过排序后的第30-40条记录. 可以使用以下语句得出默认排在第30-40条的记录. --SQL Server 2005 select top 40 * from table except select top 30 * from table --SQL Server 2000 select * from (select top 40 * from table) a where id not in (select top 30 id from table) 补充: 返回name为c,d,e的第3-5条,SQL SERVER 2000和2005均适用. select * from (select top 5 * from @t) a where id not in (select top 2 id from @t) mysql 更简单 select * from tablename limit 29,10 SQL Server select * from ( select ROW_NUMBER() over(order by t.[ID]) curr,* from [tablename ] AS t ) as t where t.curr between 30 and 40 MySQL 楼上的可以。租房 违约金 水电费。 没的那样的需求。 一般的Id 都是自动增长的。离婚协议书的范本。 要不你就将数据放入的临时的表中。 在排序提取。 畸形的问题 (责任编辑:admin) |