If I specify a number, say 5, what query will give me all the rows after the 5th row? Like,
SELECT * FROM table WHERE 1=1;
only I want it to exclude the top 5. Thanks.
Use the limit with a very high number as the second argument.
select * from myTable limit 5,18446744073709551615;
From MySQL Docs:
To retrieve all rows from a certain offset up to the end of the result set, you can use some large number for the second parameter. This statement retrieves all rows from the 96th row to the last:
SELECT * FROM tbl LIMIT 95,18446744073709551615;
BTW: You don't need WHERE 1=1
. It doesn't add any value to the query, just clutter.
SELECT * FROM table ORDER BY somecolumn LIMIT 5,1000
http://dev.mysql.com/doc/refman/5.1/en/select.html
[LIMIT {[offset,] row_count | row_count OFFSET offset}]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With