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.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.039 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.