Re: [SQL] Finding the "most recent" rows

Поиск
Список
Период
Сортировка
От Brook Milligan
Тема Re: [SQL] Finding the "most recent" rows
Дата
Msg-id 199904231442.IAA17294@trillium.nmsu.edu
обсуждение исходный текст
Ответ на Re: [SQL] Finding the "most recent" rows  (Julian Scarfe <jas1@scigen.co.uk>)
Ответы Re: [SQL] Finding the "most recent" rows
Список pgsql-sql
Tom Lane wrote:  >   > SELECT DISTINCT ON place * FROM table ORDER BY place, time DESC;  >   > might do the right
thing. It *seems* to select the first row for each  > value of place.  I've never seen a spec for this feature,
however,so  > I'm not sure if it's reliable or not...
 

Cool idea.  Is DISTINCT guarranteed to choose the first row that
matches or can it choose any row?

Cheers,
Brook


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

Предыдущее
От: "Justin Long"
Дата:
Сообщение: FW: [SQL] SELECT TOP _x_ ??
Следующее
От: "Justin Long"
Дата:
Сообщение: Large objects - bug? caveat? feature?