Re: Best way to get the latest revision from a table

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: Best way to get the latest revision from a table
Дата
Msg-id 4D307A390200002500039613@gw.wicourts.gov
обсуждение исходный текст
Ответ на Best way to get the latest revision from a table  (Nikolas Everett <nik9000@gmail.com>)
Ответы Re: Best way to get the latest revision from a table
Список pgsql-performance
Nikolas Everett <nik9000@gmail.com> wrote:

> Am I missing something or is this really the best way to do this in
8.3?

How about this?:

SELECT y.*
  from (select a, max(revision) as revision
          from test where a between 2 and 200
          group by a) x
  join test y using (a, revision);

-Kevin

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

Предыдущее
От: Chris Browne
Дата:
Сообщение: Re: "COPY TO stdout" statements occurrence in log files
Следующее
От: Nikolas Everett
Дата:
Сообщение: Re: Best way to get the latest revision from a table