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

From: Thom Brown <thombrown(at)gmail(dot)com>
To: silly8888 <silly8888(at)gmail(dot)com>
Cc: "Massa, Harald Armin" <chef(at)ghum(dot)de>, depesz(at)depesz(dot)com, pgsql-general(at)postgresql(dot)org
Subject: Re: using window-functions to get freshest value - how?
Date: 2009-11-20 12:22:07
Message-ID: bddc86150911200422r3a9d2485jd8c1b9f43e1598e9@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2009/11/20 silly8888 <silly8888(at)gmail(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Massa, Harald Armin 2009-11-20 12:38:29 Re: using window-functions to get freshest value - how?
Previous Message silly8888 2009-11-20 12:18:22 Re: using window-functions to get freshest value - how?