在SQL中如果主键字段是不连续的 如何查出表中的第三四条数据
在SQL中如果主键字段是不连续的 如何查出表中的第三四条数据
日期:2011-09-29 16:44:05 人气:1
select top 2 * from exloginrecord where id not in (select top 2 id from exloginrecord order by id )
order by id
写出一条Sql语句:取出表A中第31到第40记录(SQLServer,以自动增长的ID作为主键,注意:ID可能不是连续的。
答:
解1: select top 10 * from tsmordermanage where id not in (select top 30 id