Re: using window-functions to get freshest value - how? - Mailing list pgsql-general

From Thom Brown
Subject Re: using window-functions to get freshest value - how?
Date
Msg-id bddc86150911200422r3a9d2485jd8c1b9f43e1598e9@mail.gmail.com
Whole thread Raw
In response to Re: using window-functions to get freshest value - how?  (silly8888 <silly8888@gmail.com>)
List pgsql-general
2009/11/20 silly8888 <silly8888@gmail.com>
> 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)

I posted the answer more than hour ago:

SELECT DISTINCT ON (id_rf) * FROM rfmitzeit ORDER BY id_rf,
letztespeicherung DESC;


Ah yes, I mixed up the id_rf and id_bf.  Yeah, this is what I would use (although I personally avoid using *).

Thom

pgsql-general by date:

Previous
From: silly8888
Date:
Subject: Re: using window-functions to get freshest value - how?
Next
From: "Massa, Harald Armin"
Date:
Subject: Re: using window-functions to get freshest value - how?