Re: FETCH FIRST clause PERCENT option

Поиск
Список
Период
Сортировка
От Surafel Temesgen
Тема Re: FETCH FIRST clause PERCENT option
Дата
Msg-id CALAY4q9TdEpQo+FLJ6OQWK3fF58W_ROGc4-+wpz+ZiSWXQQApA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: FETCH FIRST clause PERCENT option  (Vik Fearing <vik.fearing@2ndquadrant.com>)
Ответы Re: FETCH FIRST clause PERCENT option  (Vik Fearing <vik.fearing@2ndquadrant.com>)
Re: FETCH FIRST clause PERCENT option  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Список pgsql-hackers


On Sun, Nov 25, 2018 at 1:24 PM Vik Fearing <vik.fearing@2ndquadrant.com> wrote:

Also, this query returns 210 rows instead of the expected 208:

    select *
    from generate_series(1, 1000)
    fetch first 20.8 percent rows only

 

this is because fetch first values work with integer and it change fractional number to nearest integer number like select * from generate_series(1, 1000) fetch first 20.3 rows only; is not an error rather it return 20 rows.

 
As for the design, I think you should put some serious consideration
into Andrew Gierth's approach.  I would rather see something like that.

 

I didn't go in that direction because I don’t understand why this approach is inferior to using window function and I am not fully understand on how to implement it.

regards

Surafel
 

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Vik Fearing
Дата:
Сообщение: Re: FETCH FIRST clause PERCENT option
Следующее
От: Vik Fearing
Дата:
Сообщение: Re: FETCH FIRST clause PERCENT option