0

How will be possible to make SELECT from the 11th number of count? I mean start SELECT from 11th row instead of 1st.

lurker
  • 56,987
  • 9
  • 69
  • 103
Tim Sadvak
  • 101
  • 12
  • 1
    Possible duplicate of [Select specific row from mysql table](https://stackoverflow.com/questions/10457458/select-specific-row-from-mysql-table) – lurker Jul 12 '17 at 00:52
  • What is "the 11th number of count"? When you count something, isn't the result just *one* number? Perhaps you could provide an example of what you mean? – David Jul 12 '17 at 00:54
  • 1
    Use `LIMIT [offset,] count` provided you have an appropriate `ORDER BY` clause. – Dai Jul 12 '17 at 00:55

2 Answers2

1

Try this if you want no limit only offset, else set a limit (number of max rows to be returned from offset row)

Select * from mytable limit 18446744073709551615 offset 10;
Allen King
  • 2,372
  • 4
  • 34
  • 52
0
SELECT
    *
FROM
    your_table
ORDER BY
    date_time_added
LIMIT 10 OFFSET 10

The LIMIT [offset,] count OFFSET [offset] clause has a few forms:

LIMIT 10          -- Returns 10 rows with ordinal range 0-9

LIMIT 5, 10       -- Returns 10 rows with ordinal range 5-14

LIMIT 10 OFFSET 5 -- The same as LIMIT 5, 10

You must have an ORDER BY clause to make the LIMIT OFFSET clause meaningful - if no ordering is defined then the relative order of rows is meaningless.

If you don't want a LIMIT value (i.e. return all rows after an offset), then MySQL requires you to specify a very large number for the LIMIT ( Mysql Offset Infinite rows )

https://dev.mysql.com/doc/refman/5.7/en/select.html

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;

In your case:

SELECT
    *
FROM
    your_table
ORDER BY
    date_time_added
LIMIT 18446744073709551615 OFFSET 5
Dai
  • 141,631
  • 28
  • 261
  • 374