Re: Select values by interval

Поиск
Список
Период
Сортировка
От Andreas Kretschmer
Тема Re: Select values by interval
Дата
Msg-id 20151123172216.GA5760@tux
обсуждение исходный текст
Ответ на Select values by interval  ("Markus Wolters" <MarkusWolters@gmx.de>)
Ответы Re: Select values by interval
Список pgsql-sql
Markus Wolters <MarkusWolters@gmx.de> wrote:

> Hi all,
> 
> I have a table with value and timestamp columns. What I like to do (but am unable to find a solution) is to select
thelast(value) timestamp combination in every X minute interval where timestamp is between N and M. Is this possible
withpgsql?
 
> 

maybe somethink like

select *, row_number() over (partition by to_char(timestamp, 'yyyy-mm-dd
hh24:mm') order by ... desc) ...


and then pick all with row_number = 1

*untested* 


Andreas
-- 
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."   (unknown)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°



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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: Select values by interval
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Select values by interval