SQL语句为: SELECT * FROM t_table t1 WHERE (SELECT count(*) FROM t_table t2 WHERE t2.id < t1.id ) > = 10 AND (SELECT count(*) FROM t_table t2 WHERE t2.id < t1.id ) < 20
又如查询t_table表中key=‘123‘第10到20条的记录,按id排序。 SELECT * FROM t_table t1 WHERE (SELECT count(*) FROM t_table t2 WHERE t2.id < t1.id AND t2.key = ‘123‘) > = 10 AND
(SELECT count(*) FROM t_table t2 WHERE t2.id < t1.id AND t2.key = ‘123‘) < 20 AND t1.key = ‘123‘