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

Поиск
Список
Период
Сортировка
От Nikolas Everett
Тема Re: Best way to get the latest revision from a table
Дата
Msg-id AANLkTi=B4yeenOdV3i3zpq_+hUpCidBS=vLi7ZRmYjhy@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Best way to get the latest revision from a table  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Ответы Re: Best way to get the latest revision from a table  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Список pgsql-performance
On Fri, Jan 14, 2011 at 5:30 PM, Kevin Grittner <Kevin.Grittner@wicourts.gov> wrote:
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);

While certainly simpler than my temp table this really just exposes a flaw in my example - I'm really going to be doing this with an arbitrary list of As.

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

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