Re: FETCH FIRST clause PERCENT option
От | Andrew Gierth |
---|---|
Тема | Re: FETCH FIRST clause PERCENT option |
Дата | |
Msg-id | 871s79qnm1.fsf@news-spur.riddles.org.uk обсуждение исходный текст |
Ответ на | Re: FETCH FIRST clause PERCENT option (Surafel Temesgen <surafel3000@gmail.com>) |
Список | pgsql-hackers |
>>>>> "Surafel" == Surafel Temesgen <surafel3000@gmail.com> writes: Surafel> this is because fetch first values work with integer and it Surafel> change fractional number to nearest integer number like select Surafel> * from generate_series(1, 1000) fetch first 20.3 rows only; is Surafel> not an error rather it return 20 rows. 31) The declared type of the <simple value specification> simply contained in <fetch first percentage> shall be numeric. Note that unlike <fetch first row count> there is no requirement for the type to be _exact_ numeric or to have scale 0. later: ii) If <fetch first percentage> is specified, then let FFP be the <simple value specification> simply contained in <fetch first percentage>, and let LOCT be a <literal> whose value is OCT. Let FFRC be the value of CEILING ( FFP * LOCT / 100.0E0 ) NOTE 333 -- The percentage is computed using the number of rows before removing the rows specified by <offset row count>. ceil(20.3 * 1000 / 100.0E0) is definitely 203, not 200. -- Andrew.
В списке pgsql-hackers по дате отправления: