Mysql retrieve all rows with limit

Simple solution is sending int's max range to method i.e 2147483647 as it is same in both mysql & c# (4 bytes) can use int.MaxValue .

see references:

  1. http://dev.mysql.com/doc/refman/4.1/en/numeric-types.html
  2. https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/integral-numeric-types.

If you want to retrieve all rows, you just don't use the LIMIT clause..


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;

This can be found in mysql developers documentation. http://dev.mysql.com/doc/refman/5.0/en/select.html

Tags:

Mysql

Sql