Re: Solution to retrieve first and last row for each minute

Поиск
Список
Период
Сортировка
От Christian Kindler
Тема Re: Solution to retrieve first and last row for each minute
Дата
Msg-id 20070822133517.107820@gmx.net
обсуждение исходный текст
Ответ на Solution to retrieve first and last row for each minute  (roopa perumalraja <roopabenzer@yahoo.com>)
Список pgsql-sql
Its really slow but what you can do is something like the following:

select count(a.*), b.* from foo.bar a,
(
select price from foo.bar order by time asc limit 1
union 
select price from foo.bar order by time desc limit 1
) as b
group by b.price
... just do the "wheres" as you need  ...

Chris

PS its untested maybe there are some syntax miss-spells



-- 
cu
Chris

Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten 
Browser-Versionen downloaden: http://www.gmx.net/de/go/browser


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

Предыдущее
От: "Aleksandr Vinokurov"
Дата:
Сообщение: Partial index and query plan
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Partial index and query plan