On Thu, May 12, 2011 at 1:45 PM, Thomas Kellerer <spam_eater(at)gmx(dot)net> wrote:
> Nguyen,Diep T wrote on 12.05.2011 03:59:
>
>>
>> Any help would be appreciated.
>>
>
> SELECT id,
> date,
> score_count,
> row_number() over (partition by id order by date desc) as order_value
> FROM your_table
>
>
>
Or the more general answer to your question is this:
http://www.postgresql.org/docs/8.4/interactive/functions-window.html
There's lots of neat things you can do with window functions.
--sam