select next/previous 10 rows in mysql -


i have list displays 10 rows.

i need select next 10 , previous 10 rows. however, ids use reference not in order. (e.g., 1,2,5,10,15). how select next few rows using id?

you can try limit:

select * `table` limit <startindex>,<numberofrecords>; 

example:-

select * `user` limit 5,10; 

this return 10 rows starting 6th row.


Comments