I wish to Choose all rows aside from the very first 5 rows inside a table.
How do you do this?
Why cant I simply type
$query = "Choose * FROM age range OFFSET 5 ORDER BY id ASC"
Choose * FROM tbl LIMIT 5,18446744073709551615
To retrieve all rows from the certain offset as much as the finish from the result set, you should use some high number for that second parameter. This statement retrieves all rows in the 96th row towards the last:
Choose * FROM tbl LIMIT 95,18446744073709551615
choose title, cost from products where rownum > 5
I simply typed:
$query = "SELECT * FROM ages LIMIT 100 OFFSET 10";
Why could not anybody produce this kind of easy answer? :)
Here is a solution using variables - just add your order by clause and you ought to be set.
set @n=-1 select * from TABLE where (@n:=@n+1) >= 5;