Re: using window-functions to get freshest value - how?
От | Massa, Harald Armin |
---|---|
Тема | Re: using window-functions to get freshest value - how? |
Дата | |
Msg-id | e3e180dc0911200231v3ef9eea0p61dd9640c66fae51@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: using window-functions to get freshest value - how? (Thomas Kellerer <spam_eater@gmx.net>) |
Ответы |
Re: using window-functions to get freshest value - how?
Re: using window-functions to get freshest value - how? |
Список | pgsql-general |
id_bf, wert, letztespeicherung:
no, that does not work:
"id_bf";"wert";"max"
98;"blue";"2009-11-10 00:00:00"
98;"red";"2009-11-10 00:00:00"
result is: I get the date of the youngest value.
My expected result is:
98;"red"
(that is, the entry of "wert" that is youngest)
thanks for trying,
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
Not tested:98, 'blue', 2009-11-09
98, 'red', 2009-11-10
now I have a select to get the "youngest value" for every id_bf:
SELECT id_bf, wert,
max(letztespeicherung) over (partition by id_bf)
FROM rfmitzeit
no, that does not work:
"id_bf";"wert";"max"
98;"blue";"2009-11-10 00:00:00"
98;"red";"2009-11-10 00:00:00"
result is: I get the date of the youngest value.
My expected result is:
98;"red"
(that is, the entry of "wert" that is youngest)
thanks for trying,
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
В списке pgsql-general по дате отправления: