Re: using window-functions to get freshest value - how?

Поиск
Список
Период
Сортировка
От Thom Brown
Тема Re: using window-functions to get freshest value - how?
Дата
Msg-id bddc86150911200417g16515343t7e2a2253ca91442e@mail.gmail.com
обсуждение исходный текст
Ответ на Re: using window-functions to get freshest value - how?  ("Massa, Harald Armin" <chef@ghum.de>)
Ответы Re: using window-functions to get freshest value - how?  ("Massa, Harald Armin" <chef@ghum.de>)
Список pgsql-general
2009/11/20 Massa, Harald Armin <chef@ghum.de>
> > Is it possible? How would the SQL utilizing WINDOW-functions look like?
>
> there is no point in using window functions in here - simply use
> "DISTINCT ON".

and how would I use DISTINCT ON for this query? Please bear in mind,
that there is more then one id_bf (just stopped the sample data with
one of them)

Best wishes,

Harald


--
GHUM Harald Massa
persuadere et programmare
Harald Armin Massa
Spielberger Straße 49
70435 Stuttgart
0173/9409607
no fx, no carrier pigeon
-
%s is too gigantic of an industry to bend to the whims of reality

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Would this work?

SELECT DISTINCT ON (id_bf) id_bf, wert, letztespeicherung
FROM rfmitzeit
ORDER BY id_bf, letztespeicherung ASC;

Regards

Thom

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

Предыдущее
От: "Massa, Harald Armin"
Дата:
Сообщение: Re: using window-functions to get freshest value - how?
Следующее
От: "A. Kretschmer"
Дата:
Сообщение: Re: using window-functions to get freshest value - how?