I want to query all records from number 50 and up. So instead of doing something like LIMIT 49, 99999
I want to know if there is an official way.
Asked
Active
Viewed 1.3k times
5
-
possible duplicate of [Mysql Offset Infinite rows](http://stackoverflow.com/questions/255517/mysql-offset-infinite-rows) – hsz Apr 11 '11 at 09:23
-
for this u can give condition by the primary key of that table know. – Sakthi Apr 11 '11 at 09:24
1 Answers
14
No, sorry. From the MySQL Documentation:
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;

Konerak
- 39,272
- 12
- 98
- 118
-
Okay, thanks. But may I ask why you edited my first post? Is it forbidden to say hi and thanks? – priktop Apr 11 '11 at 09:35
-
3No, it's not forbidden at all, but the title was rather vague, so I was going to edit it - and the hi/thanks don't add any useful content here for the future visitors on Stackoverflow ;) – Konerak Apr 11 '11 at 09:40
-
9@Konerak: actually, I care about "Hi" and "Thanks". Being polite always help in getting an answer. – Johann Blais Apr 11 '11 at 09:59
-
4@Johann: There has been quite a conversation on meta about this, see [Should 'Hi', 'thanks' and taglines and salutations be removed from posts?](http://meta.stackexchange.com/questions/2950/should-hi-thanks-and-taglines-and-salutations-be-removed-from-posts) and [Are taglines & signatures disallowed?](http://meta.stackexchange.com/questions/5029/are-taglines-signatures-disallowed) - I tend to agree hi-thx-bye is just clutter. I won't edit a question that cannot be improved otherwise just to remove them, but while I'm improving, I'll improve the language and remove the clutter. – Konerak Apr 11 '11 at 11:32
-
1@priktop: [You're not a noob, more a newb](http://www.cad-comic.com/cad/20060823) - I hope ;) – Konerak Apr 11 '11 at 11:39
-
I must be doing something wrong. I'm using Microsoft SQL Mgmt Studio, ver 17.9.1. When I try to use the LIMIT like show here, I get – Mar 21 '19 at 15:27