I want to retrieve all rows of a particular user with limit 0,x..
So i just want to ask is there any way to retrieve all rows in mysql without calling a method which returns count(id) of x& without making an overload of existing function which does not have limit at all in query & withour string.Relace() functionality.
As internally mysql is might using this when we check show all check Box then all rows of taht table are displayed
In MySQL the LIMIT clause is used with the SELECT statement to restrict the number of rows in the result set. The Limit Clause accepts one or two arguments which are offset and count. The value of both the parameters can be zero or positive integers.
To select first 10 elements from a database using SQL ORDER BY clause with LIMIT 10. Insert some records in the table using insert command. Display all records from the table using select statement.
You use the LIMIT clause to constrain the number of rows returned by the query. For example, a SELECT statement may return one million rows. However, if you just need the first 10 rows in the result set, you can add the LIMIT clause to the SELECT statement to retrieve 10 rows.
MySQL provides a LIMIT clause that is used to specify the number of records to return. The LIMIT clause makes it easy to code multi page results or pagination with SQL, and is very useful on large tables. Returning a large number of records can impact on performance.
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
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:
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