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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Nikolas Everett <nik9000@xxxxxxxxx> 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

-- 
Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux