IT@

MySQLˡrcW

w PConline IT@

MySQLˡrcW

MySQLDޯKasήٷ޾QMKةMysqlˡrcWּZysqlˡrcWezWf

cW1rbHSQL

pySQLQuBcWeELECT * FROM `ѩLIMIT M拴

觳˒MPɡ򫪩rrv(㾭Nྭb)

ԍ/yi``NHyQ觍`ZdBڪܺSEYdzeQkctGڮYd2)imit–WιEMFæGDٵUQ㦷i]

MySQLˡrcW

cW2wILAJxdwnr10

pySQLQuBcW

WB

SELECT * FROM `ѩWHERE id_pk > (pageNum*10) LIMIT M

觳˒MPɡ򫪩㾭N{

ԍxdNHyQ觍`Zu٫MveΗIBpk_idդfQSZظMQcW3

cW3ιxdKԩդf

pySQLQuBcWeELECT * FROM `ѩWHERE id_pk > (pageNum*10) ORDER BY id_pk ASC LIMIT M

觳˒MPɡ򫪩㾭N{. ǹORDER BYι\JήBiWQFORDERBYcVǕJxd@PبFEqze(ѽD]KQZcW1)

ԍxdNHyQ觍`Z FFySQLSݧFfQASC[JDESC(DESCqoQZfJESCB

MySQLˡr8I\

cW4ιxdڼbrepare(ٷơageNumְy`Anr㾭N

pySQLQuBcW

WB

PREPARE stmt_name FROM SELECT * FROM `ѩWHERE id_pk > (?* ?) ORDER BY id_pk

ASC LIMIT M

觳˒MP

ԍxdNHyQ觍`Z prepareUv{`

cW5JAySQLsORDERcquAeB\訣㾭Nx`NH

䱫r000019`ٺpkqILL

WB

SELECT * FROM your_table WHERE pk>=1000 ORDER BY pk ASC LIMIT 00

cW6Jquot;svYϴF+A"eB\㾭N\Qѫٺ 覓QI\

idqILLQsvv

qusvAZ

WB

SELECT* FROMyour_table WHEREid <=

(SELECTid FROMyour_table ORDER

BYid descLIMIT ($page-1)*$pagesize ORDERBYid desc

LIMIT $pagesize

quYϴFF

WB

SELECT* FROMyour_table ASt1

JOIN(SELECTid FROMyour_table ORDERBY

id descLIMIT ($page-1)*$pagesize ASt2

WHERE

t1.id <= t2.id ORDERBYt1.id descLIMIT $pagesize;

MySQLˡr

cW7oݣ^ҳQ(ǹfѮkcW5/6)

pBGع٫

觳˒MPyQI\

ԍc˵壷\Wr

cW8I\

~bSQL_CALC_FOUND_ROWSQfQ؈gW

䱑گMQT⪩ήCFI\VʫJ㦷rܺSQTDMHYWsORDER BYcquAasFe]դf

Urp

M

aZ

`ᦼ