Re: SQL Question - Almost, Not Quite...

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: SQL Question - Almost, Not Quite...
Дата
Msg-id 20060525215646.GA6020@wolff.to
обсуждение исходный текст
Ответ на Re: SQL Question - Almost, Not Quite...  (<operationsengineer1@yahoo.com>)
Список pgsql-novice
On Thu, May 25, 2006 at 14:30:05 -0700,
  operationsengineer1@yahoo.com wrote:
>
> Bruno, no worries.  i didn't explain what i wanted too
> well.  i'm *only* interested in the last (latest
> timestamp) inspect_result for each inspect_id.

Then DISTINCT ON is the the simplest way to do this. You can ORDER BY
inspect_id DESC, timestamp DESC to get the last record for each inspect_id.
This is not standard SQL though.

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

Предыдущее
От:
Дата:
Сообщение: Re: SQL Question - Almost, Not Quite...
Следующее
От:
Дата:
Сообщение: Re: SQL Question - S/B Good...