select?*?from?persons?limit??A??offset??B;
解釋:
A就是你需要多少行;
B就是查詢的起點(diǎn)位置。
示例:
select?*?from?persons?limit?5?offset?0?;
意思是,起點(diǎn)0開(kāi)始查詢,返回5條數(shù)據(jù)。

select?*?from?persons?limit?5?offset?5?;
意思是,起點(diǎn)5開(kāi)始查詢,返回5條數(shù)據(jù)。

特殊:
select?*?from?persons?limit?5?;
這個(gè)就類(lèi)似:
select?*?from?persons?limit?5?offset?0;
也就是,從起點(diǎn)0開(kāi)始查詢,返回5條數(shù)據(jù)。
按規(guī)則排序,同時(shí)也要分頁(yè):
select?*?from?persons
order?by?lastname
limit?5?offset?0;