Oracle及MS-SQL都有RowNumber的語法可用
MySQL則需要使用一些技巧
select x.id,x.val,x.seq, @i := @i + 1 as row_number
from (
select 222 as seq,'row1' as id,'value1' as val from dual
union all
select 111 as seq,'row2' as id,'value2' as val from dual
) x,(select @i := 0) temp order by x.seq;
資料
加了Rownumber後
limit Start_Row,Page Of Row
limit 10,20