Re: selecting latest record

Поиск
Список
Период
Сортировка
От Louis-David Mitterrand
Тема Re: selecting latest record
Дата
Msg-id 20090922100232.GA26478@apartia.fr
обсуждение исходный текст
Ответ на Re: selecting latest record  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-sql
On Tue, Sep 22, 2009 at 11:56:54AM +0200, Pavel Stehule wrote:
> 
> there are more ways - depends on what you wont.
> 
> one way is
> 
> SELECT *
>    FROM price
>   WHERE (id_product, date) = (SELECT id_product, max(date)
>                                                                FROM price
>                                                               GROUP BY
> id_product)

Nice. 

I didn't know one could have several args in a single WHERE clause.

Thanks,


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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: selecting latest record
Следующее
От: "A. Kretschmer"
Дата:
Сообщение: Re: selecting latest record