mysql database limit paging, sorting operation

I see a lot of online friends asking, limit the problem in accordance with field properties page after sorting, and here to share my usage:

  1. Online Answer:    

    5 per page, third page display information, according to age from small to large
    select * from student order by age asc limit 10,5;

    

    

 

    The answer is to achieve a sort, then paging operation, but not many people want this effect, because it just sort of the original data table is completely different, in fact, want to get the results of the first page is very simple reordering .

  2. My usage:

    Very simple, only need to add a small query operations outside parentheses to elevate the priority;

    (select * from student limit 10,5)order by age asc ;

    

    

 

Guess you like

Origin www.cnblogs.com/pyyolo/p/11228001.html