Received: from mail.utexas.edu (wb2-a.mail.utexas.edu [128.83.126.136]) by postgresql.org (8.11.3/8.11.1) with SMTP id f6FIVSa71778 for ; Sun, 15 Jul 2001 14:31:29 -0400 (EDT) (envelope-from webmaster@robbyslaughter.com) Received: (qmail 2918 invoked by uid 0); 15 Jul 2001 18:31:26 -0000 Received: from adsl-64-218-163-131.dsl.austtx.swbell.net (HELO robmanbox) (64.218.163.131) by umbs-smtp-2 with SMTP; 15 Jul 2001 18:31:26 -0000 Reply-To: From: "Robby Slaughter" To: "Josh Berkus" , Subject: RE: Hey! ORDER BY in VIEWS? Date: Sun, 15 Jul 2001 13:32:28 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) X-Mimeole: Produced By Microsoft MimeOLE V5.50.4133.2400 Importance: Normal In-Reply-To: X-Archive-Number: 200107/184 X-Sequence-Number: 3979 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