Selecting all records using SQL LIMIT and OFFSET query

后端 未结 7 593
一向
一向 2020-12-08 20:09

I wonder if there is a way to accomplish:

SELECT * FROM table

by using LIMIT and OFFSET like so:

         


        
7条回答
  •  甜味超标
    2020-12-08 20:15

    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;

    So getting all rows might look as follows:

    SELECT * FROM tbl LIMIT 0,18446744073709551615;
    

提交回复
热议问题