Reputation: 28030
I have the following MySQL query;
SELECT records FROM users
LIMIT 1
One record will be retrieved. Suppose I want to retrieve all records but still use the keyword LIMIT. Can I do something like this?
SELECT records FROM users
LIMIT ALL
Upvotes: 2
Views: 4931
Reputation: 21
If you want to retrieve all data then just use
select * from tbl;
Upvotes: -1
Reputation: 2012
Just use
SELECT records FROM users
Do not use LIMIT at all
Or if it is required to use LIMIT , use a very high number
SELECT records FROM users LIMIT 999999999999
Upvotes: 5
Reputation: 184
According to mysql doc you are supposed to use a very large number.
SELECT * FROM tbl LIMIT 95,18446744073709551615;
Terrible solution, if you ask me, but its from the mysql documentation
http://dev.mysql.com/doc/refman/5.0/en/select.html#id4651990
Upvotes: 1
Reputation: 2869
You have to just make up a ridiculous number and limit it by that.
E.g. SELECT records FROM users LIMIT 18446744073709551615
if you really want to keep the limit clause. This is similar to using offset to infinite amount.
Upvotes: 2