Re: Need help for constructing query

Поиск
Список
Период
Сортировка
От Marco
Тема Re: Need help for constructing query
Дата
Msg-id 4d8ca252$0$7654$9b4e6d93@newsspool1.arcor-online.net
обсуждение исходный текст
Ответы Re: Need help for constructing query  ("David Johnston" <polobo@yahoo.com>)
Список pgsql-general
Just want to add:

> 1) Display the rows with the highest date per id. That gives as many rows as
>    ids exist.
>
> select id, max(date) from mytable group by id;
>
> gives just the id and the date, not the other values. I think of doing this
> in two steps:

select id, max(date),min,value,max from mytable group by id,min,value,max;

Gives too many rows. I don't know why. If I can manage to fix the query above
just to output one row per id I can solve it.


Marco


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

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: ERROR: type "foo_20110307_id_seq" already exists (expected relation "foo_20110307_id_seq" already exists)
Следующее
От: Marco
Дата:
Сообщение: Need help for constructing query