分页的另一种方式

SELECT SQL_CALC_FOUND_ROWS id,name limit 1,10;

SELECT FOUND_ROWS();

SELECT id, title, content FROM article
INNER JOIN (
    SELECT id FROM article ORDER BY created DESC LIMIT 10000, 10
) AS page USING(id)

 

 

你可能感兴趣的:(分页)