Re: returning row numbers in select

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: returning row numbers in select
Дата
Msg-id 13737.1078959704@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: returning row numbers in select  (Randall Skelton <skelton@brutus.uwaterloo.ca>)
Список pgsql-general
Randall Skelton <skelton@brutus.uwaterloo.ca> writes:
>> Couldn't you code this as a WHERE test on the timestamp?

> That would be ideal as it is theoretically possible for there to be
> missing rows due to sampling errors; nevertheless, a WHERE test doesn't
> seem obvious to me.  Can you please post an example?

Something like
    WHERE (EXTRACT(EPOCH FROM timestamp)::numeric % 5) = 0;
The EXTRACT function returns double precision, but there's no double
modulo operator for some reason, hence the cast to numeric which does
have one.

            regards, tom lane

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

Предыдущее
От: Randall Skelton
Дата:
Сообщение: Re: returning row numbers in select
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: returning row numbers in select