MySQL select limit specifies the number of rows to query MySQL, which is the most widely used database. It is known for its lightweight, open-source, and efficient nature. Once a product owned by SUN, as SUN was acquired by Oracle, MySQL was also transferred to Oracle. Compared with Microsoft's ms SQL Server, Oracle and MySQL have many advantages and features. MySQL provides a simpler and clearer way to query the specified number of rows than other databases. When we use the select function to query data, what if we want to return the first few or several intermediate results? It's easy to add the limit constraint at the end of the statement. LIMIT (case insensitive, because MySQL commands are case insensitive) constraints are used to LIMIT the number of rows returned by a SELECT statement. LIMIT can be followed by one or two Integer constants, if there are two integers, the first integer is used to specify the offset of the first returned result, and the second integer is used to specify the maximum number of returned results. However, it is worth noting that the offset of the first result is 0 (instead of 1). If you only care about the first result, you can use the following statement.
[SQL] select * from table limit 0, 1;
If LIMIT is only followed by an integer n, only the first n records are searched. Therefore, limit n is equivalent to limit 0, n.
[SQL] select * from table limit 7,100; // search records row 8-100 select * from table limit 7,-1; // select * from table limit 7 from row 8 to last line of the record; // select * from table limit for the first 7 rows of the record; // equivalent to the previous command, search for the first seven rows of records