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

Поиск
Список
Период
Сортировка
От Chris Bitmead
Тема Re: [SQL] Finding the "most recent" rows
Дата
Msg-id 37286C86.8E0472A6@bigfoot.com
обсуждение исходный текст
Ответ на Re: [SQL] Finding the "most recent" rows  (Brook Milligan <brook@trillium.NMSU.Edu>)
Ответы Re: [SQL] Finding the "most recent" rows
Список pgsql-sql
Herouth Maoz wrote:

> Tables are considered as unordered sets. There can not be anything in the
> standard that relies on the order in the table. And what do you mean by
> inserting a preceding ORDER BY step?

He was suggesting that an ORDER BY combined with a DISTINCT might be a
good way of solving the difficult problem of finding the, say,
max(field) in different groups in the table. (And it does work for
postgresql) Like a SELECT ...GROUP BY except getting back not just the
group fields but all fields.

You say that a table is "considered an unordered set". But surely a
table is not an unordered set if you've specified an ORDER BY clause?
This idea is so nice, it would be ashame to dismiss it too quickly.


-- 
Chris Bitmead
http://www.bigfoot.com/~chris.bitmead
mailto:chris.bitmead@bigfoot.com


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

Предыдущее
От: José Soares
Дата:
Сообщение: Re: [SQL] LIMIT
Следующее
От: Herouth Maoz
Дата:
Сообщение: Re: [SQL] Finding the "most recent" rows