X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 3EDBBD1B53E for ; Sat, 1 Nov 2003 05:16:37 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 57382-03 for ; Sat, 1 Nov 2003 01:16:06 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id AF4D4D1B509 for ; Sat, 1 Nov 2003 01:16:05 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id hA15G4Nu012151 for ; Sat, 1 Nov 2003 05:16:04 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id hA14jEMW007696 for pgsql-general@postgresql.org; Sat, 1 Nov 2003 04:45:14 GMT From: nzanella@cs.mun.ca (Neil Zanella) X-Newsgroups: comp.databases.postgresql.general Subject: AS operator and subselect result names: PostgreSQL vs. Oracle Date: 31 Oct 2003 20:44:19 -0800 Organization: http://groups.google.com Lines: 23 Message-ID: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: groups-abuse@google.com To: pgsql-general@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/21 X-Sequence-Number: 51671 Hello, I would like to ask the about the following... PostgreSQL allows tables resulting from subselects to be renamed with an optional AS keyword whereas Oracle 9 will report an error whenever a table is renamed with the AS keyword. Furthermore, in PostgreSQL when the result of a subselect is referenced in an outer select it is required that the subselect result be named, whereas this is not true in Oracle. I wonder what standard SQL has to say about these two issues. In particular: 1. Does standard SQL allow an optional AS keyword for (re/)naming tables including those resulting from subselects. and 2 Why must a subselect whose fields are referenced in an outer query be explicitly named in PostgreSQL when it is not necessary in Oracle. Thanks, Neil