SQL語(yǔ)句為: 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‘