RE: Hey! ORDER BY in VIEWS?

From: "Robby Slaughter" <webmaster(at)robbyslaughter(dot)com>
To: "Josh Berkus" <josh(at)agliodbs(dot)com>, <pgsql-sql(at)postgresql(dot)org>
Subject: RE: Hey! ORDER BY in VIEWS?
Date: 2001-07-15 18:32:28
Message-ID: EPEHLKLEHAHLONFOKNHNCENADCAA.webmaster@robbyslaughter.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I think PostgreSQL allows you to do an ORDER BY in a view, but the real
message is that it just doesn't make any sense. Remember that a view is
just a "virtual table", not a query. If you "order by" as part of it's
definition, there's no guarantee that the data will be orded when you SELECT
FROM later on.

Always, always, always include an ORDER BY clause in every select you do.
(I personally think SQL ought to REQUIRE it!)

-Robby

-----Original Message-----
From: pgsql-sql-owner(at)postgresql(dot)org
[mailto:pgsql-sql-owner(at)postgresql(dot)org]On Behalf Of Josh Berkus
Sent: Sunday, July 15, 2001 12:22 PM
To: pgsql-sql(at)postgresql(dot)org
Subject: [SQL] Hey! ORDER BY in VIEWS?

Tom, Stephan,

Hey! I thought you couldn't do ORDER BY in views ... yet I just did.
Is this a new thing, or am I just getting my Trasact-SQL and my
PostgreSQL mixed up again?

-Josh

______AGLIO DATABASE SOLUTIONS___________________________
Josh Berkus
Complete information technology josh(at)agliodbs(dot)com
and data management solutions (415) 565-7293
for law firms, small businesses fax 621-2533
and non-profit organizations. San Francisco

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Bruce Momjian 2001-07-15 18:45:59 Re: Hey! ORDER BY in VIEWS?
Previous Message Josh Berkus 2001-07-15 17:21:31 Hey! ORDER BY in VIEWS?