Remove ROW | ROWS from OFFSET and FETCH

Поиск
Список
Период
Сортировка
Искать

Remove ROW | ROWS from OFFSET and FETCH

От:
Thom 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

Re: Remove ROW | ROWS from OFFSET and FETCH

От:
Marko Tiikkaja <marko.tiikkaja@cs.helsinki.fi>
Дата:
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

Re: Remove ROW | ROWS from OFFSET and FETCH

От:
Thom Brown <thombrown@gmail.com>
Дата:
On 26 March 2010 00:14, Marko Tiikkaja  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

FAQ