Bug #50659 Using OFFSET without LIMIT
Submitted: 27 Jan 2010 13:00 Modified: 19 Feb 2010 12:59
Reporter: timor kodal Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Parser Severity:S4 (Feature request)
Version: OS:Any
Assigned to: CPU Architecture:Any
Tags: limit, OFFSET

[27 Jan 2010 13:00] timor kodal
Description:
I find it a bit awkward that thereĀ“s no way to make mysql use an OFFSET WITHOUT a given LIMIT.

Using "SELECT * FROM `table` LIMIT 0,12340283492834" is not really elegant imho.

i would rather like to use something like "SELECT * FROM `table` OFFSET 10" (without the LIMIT keyword), or "SELECT * FROM `table` LIMIT 10,-1"

How to repeat:
using "SELECT * FROM `table` OFFSET 10" (without the LIMIT keyword) returns a parsing error.

Suggested fix:
"SELECT * FROM `table` OFFSET 10" 
or 
"SELECT * FROM `table` LIMIT 10,-1"
[19 Feb 2010 12:59] Susanne Ebrecht
LIMIT is not SQL Standard.

The OFFSET MySQL implemented is an offset for LIMIT:

LIMIT {[offset,] row_count | row_count OFFSET offset}

What you mean here is the OFFSET from SQL Stadard:

OFFSET <offset row count> { ROW | ROWS }

This would be a new feature for MySQL.