pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robby Slaughter <webmaster@robbyslaughter.com>
To: Josh Berkus <josh@agliodbs.com>
To: pgsql-sql@postgresql.org
Subject: RE: Hey! ORDER BY in VIEWS?
Date: Sun, 15 Jul 2001 13:32:28 -0500
Message-ID: <EPEHLKLEHAHLONFOKNHNCENADCAA.webmaster@robbyslaughter.com> (raw)
In-Reply-To: <web-85926@davinci.ethosmedia.com>

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@postgresql.org
[mailto:pgsql-sql-owner@postgresql.org]On Behalf Of Josh Berkus
Sent: Sunday, July 15, 2001 12:22 PM
To: pgsql-sql@postgresql.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@agliodbs.com
   and data management solutions       (415) 565-7293
  for law firms, small businesses        fax 621-2533
    and non-profit organizations.      San Francisco




view thread (11+ messages)  latest in thread

Message-ID: <EPEHLKLEHAHLONFOKNHNCENADCAA.webmaster@robbyslaughter.com>
Permalink:  ../EPEHLKLEHAHLONFOKNHNCENADCAA.webmaster@robbyslaughter.com/
Also on:    postgresql.org/message-id/EPEHLKLEHAHLONFOKNHNCENADCAA.webmaster@robbyslaughter.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: webmaster@robbyslaughter.com, josh@agliodbs.com
  Subject: RE: Hey! ORDER BY in VIEWS?
  In-Reply-To: <EPEHLKLEHAHLONFOKNHNCENADCAA.webmaster@robbyslaughter.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox