Re: Best way to get the latest revision from a table - Mailing list pgsql-performance

From Kevin Grittner
Subject Re: Best way to get the latest revision from a table
Date
Msg-id 4D307A390200002500039613@gw.wicourts.gov
Whole thread Raw
In response to Best way to get the latest revision from a table  (Nikolas Everett <nik9000@gmail.com>)
Responses Re: Best way to get the latest revision from a table  (Nikolas Everett <nik9000@gmail.com>)
List 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 by date:

Previous
From: Chris Browne
Date:
Subject: Re: "COPY TO stdout" statements occurrence in log files
Next
From: Nikolas Everett
Date:
Subject: Re: Best way to get the latest revision from a table