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

From: Chris Bitmead <chris(dot)bitmead(at)bigfoot(dot)com>
To: pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] Finding the "most recent" rows
Date: 1999-04-29 14:28:22
Message-ID: 37286C86.8E0472A6@bigfoot.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)bitmead(at)bigfoot(dot)com

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Mark Jewiss 1999-04-29 14:57:38 Re: [SQL] LIMIT
Previous Message José Soares 1999-04-29 14:02:15 Re: [SQL] LIMIT