Remove ROW | ROWS from OFFSET and FETCH

Started by Thom Brownalmost 16 years ago3 messages
#1Thom Brown
thombrown@gmail.com

Hi,

I was wondering if it might be worth making ROW/ROWS optional for
OFFSET and FETCH clauses? And can ONLY be optional too?

So:

OFFSET start { ROW | ROWS }
FETCH { FIRST | NEXT } [ count ] { ROW | ROWS } ONLY

Would become

OFFSET start [ ROW | ROWS ]
FETCH { FIRST | NEXT } [ count ] [ ROW | ROWS ] [ONLY]

So instead of:

SELECT *
FROM my_table
OFFSET 4 ROWS
FETCH FIRST 10 ROWS ONLY;

one could write:

SELECT *
FROM my_table
OFFSET 4
FETCH FIRST 10;

The only case where ROW would be mandatory would be for FETCH FIRST ROW ONLY.

...although I suspect I'm missing something obvious or reasonable here ;)

Thom

#2Marko Tiikkaja
marko.tiikkaja@cs.helsinki.fi
In reply to: Thom Brown (#1)
Re: Remove ROW | ROWS from OFFSET and FETCH

On 3/26/10 2:01 AM +0200, Thom Brown wrote:

I was wondering if it might be worth making ROW/ROWS optional for
OFFSET and FETCH clauses? And can ONLY be optional too?

AIUI the only time you'd want to use that syntax is when you want to
write (theoretically) portable code, and making parts of the syntax
optional is just breaking that portability. We already have a
non-portable, non-standard syntax.

Regards,
Marko Tiikkaja

#3Thom Brown
thombrown@gmail.com
In reply to: Marko Tiikkaja (#2)
Re: Remove ROW | ROWS from OFFSET and FETCH

On 26 March 2010 00:14, Marko Tiikkaja <marko.tiikkaja@cs.helsinki.fi> wrote:

On 3/26/10 2:01 AM +0200, Thom Brown wrote:

I was wondering if it might be worth making ROW/ROWS optional for
OFFSET and FETCH clauses?  And can ONLY be optional too?

AIUI the only time you'd want to use that syntax is when you want to write
(theoretically) portable code, and making parts of the syntax optional is
just breaking that portability.  We already have a non-portable,
non-standard syntax.

I understand. If that's the case I'll concede the point. :)

Thanks

Thom