Re: selecting records X minutes apart

Поиск
Список
Период
Сортировка
От lists-pgsql@useunix.net
Тема Re: selecting records X minutes apart
Дата
Msg-id 20110604191559.GA16254@slacker.ja10629.home
обсуждение исходный текст
Ответ на Re: selecting records X minutes apart  (Jasen Betts <jasen@xnet.co.nz>)
Ответы Re: selecting records X minutes apart  (Richard Broersma <richard.broersma@gmail.com>)
Список pgsql-sql
On Sat, Jun 04, 2011 at 11:45:08AM +0000, Jasen Betts wrote:
> On 2011-06-03, lists-pgsql@useunix.net <lists-pgsql@useunix.net> wrote:
> >
> > ID    TS (HH:MM)
> > -------------------
> > 0    20:00
> > 0    20:05
> > 0    20:10
> > 1    20:03
> > 1    20:09
> >
> >
> > Does my question make sense?
> 
> no, why is (1,20:04) excluded, but (0,20:05) included?
> both records are 5 minutes from the newest.

Jasen,

(1,20:04) is excluded because it's timestamp is less than 5 minutes from the
previous record with the same ID (1,20:03), (0,20:05) is included for the
opposite reason.

Let me restate my requirement again with a little more detail.  I want to
select records grouped by ID, ordered by timestamp, in ascending order so I'm
starting with the oldest, that are at least X minutes apart.

I hope that helps.

Thanks again,
Wayne


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

Предыдущее
От: lists-pgsql@useunix.net
Дата:
Сообщение: Re: selecting records X minutes apart
Следующее
От: Richard Broersma
Дата:
Сообщение: Re: selecting records X minutes apart