4,用一个Sql语句查找第12到73的记录。ID是自增长的,但不是连续的。
select *
from 表 a join(
select mobile from 表
group by mobile
having count(*) between 12 and 73
)b on a.mobile=b.mobile
select * from (select t.uid
,(select count(*) from sysusers s where s.uid<t.uid)as sort
from sysusers t) t where t.sort>12 and sort<73
select top (73-12) * from (select top 73 * from 表 ordr by id DESC) AS
t1 order by id DESC
select top 73 * from SHIPPER_MATERIALS where sm_id not in(select top 12
sm_id from SHIPPER_MATERIALS)
select * from (select t.uid
,(select count(*) from sysusers s where s.uid<t.uid)as sort
from sysusers t) t where t.sort>=12 and sort=<73