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

От: Shaun Thomas
Тема: Re: Best way to get the latest revision from a table
Дата: ,
Msg-id: D247E79EFD801E40A9449A9724F6295B4C5F5F4E@spswchi6mail1.peak6.net
(см: обсуждение, исходный текст)
Ответ на: Re: Best way to get the latest revision from a table  (Tom Lane)
Список: pgsql-performance

Скрыть дерево обсуждения

Best way to get the latest revision from a table  (Nikolas Everett, )
 Re: Best way to get the latest revision from a table  ("Kevin Grittner", )
  Re: Best way to get the latest revision from a table  (Nikolas Everett, )
   Re: Best way to get the latest revision from a table  ("Kevin Grittner", )
 Re: Best way to get the latest revision from a table  (Shaun Thomas, )
  Re: Best way to get the latest revision from a table  ("Kevin Grittner", )
   Re: Best way to get the latest revision from a table  (Tom Lane, )
    Re: Best way to get the latest revision from a table  ("Kevin Grittner", )
     Re: Best way to get the latest revision from a table  (Nikolas Everett, )
      Re: Best way to get the latest revision from a table  (Shaun Thomas, )
      Re: Best way to get the latest revision from a table  (Robert Haas, )
       Re: Best way to get the latest revision from a table  (Nikolas Everett, )
    Re: Best way to get the latest revision from a table  (Shaun Thomas, )

> Shaun's example is a bit off: normally, when using DISTINCT ON, you want
> an ORDER BY key that uses all the given DISTINCT keys and then some
> more.  To get the max revision for each a/b combination it ought to be

Hah, well i figured I was doing something wrong. I just thought about it a little bit, said to myself: "Hey, I've used
thisbefore to get the most recent x for a bunch of y without a sub-query. We always used it to get the newest update to
anevent log. 

But that's why I said I was probably misunderstanding something. :) I was trying to pick apart the logic to his temp
tablesand saw the max(b) and it threw me off. Glad you're around to set it straight. Heh. 


______________________________________________

See  http://www.peak6.com/email_disclaimer.php
for terms and conditions related to this email


В списке pgsql-performance по дате сообщения:

От: Shaun Thomas
Дата:
Сообщение: Re: Best way to get the latest revision from a table
От: Craig Ringer
Дата:
Сообщение: Re: The good, old times