Re: returning row numbers in select - Mailing list pgsql-general

From Tom Lane
Subject Re: returning row numbers in select
Date
Msg-id 13737.1078959704@sss.pgh.pa.us
Whole thread Raw
In response to Re: returning row numbers in select  (Randall Skelton <skelton@brutus.uwaterloo.ca>)
List 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 by date:

Previous
From: Randall Skelton
Date:
Subject: Re: returning row numbers in select
Next
From: Bruno Wolff III
Date:
Subject: Re: returning row numbers in select