Received: from sss.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.9.3/8.9.3) with ESMTP id NAA75015 for ; Sun, 29 Aug 1999 13:03:14 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.sss.pgh.pa.us (8.9.1/8.9.1) with ESMTP id NAA12278; Sun, 29 Aug 1999 13:02:33 -0400 (EDT) To: avalon@teleweb.at cc: pgsql-sql@postgreSQL.org Subject: Re: [SQL] SELECT multiple tables with same fields In-reply-to: Your message of Sun, 29 Aug 1999 17:43:04 +0200 <37C95508.B50F49BD@AVALON.at> Date: Sun, 29 Aug 1999 13:02:32 -0400 Message-ID: <12276.935946152@sss.pgh.pa.us> From: Tom Lane "Dipl.-Ing. Thomas Schallar" writes: > Before I started programming with Postgres I've done my stuff with > Microsoft Visual Basic and Access. Access has the lovely feature, that > doubly selected column names are automatically renamed to > . (or _? I can't remember at > the moment; sorry!) so everything works fine. Hmm. That is arguably a violation of SQL92: the spec says 9) Case: a) If the i-th in the does not specify an and the of that is a single , then the of the i-th column of the result is C. ["C" here apparently refers to the within the --- tgl] c) Otherwise, the of the i-th column of the is implementation-dependent and different from the of any column, other than itself, of a table referenced by any contained in the SQL-statement. So, it appears to me that an implementation has flexibility about the column name to assign to an expression result, but none about the name to assign to a simple variable reference. Which is too bad, because I agree that assigning nonduplicate column names would be more useful behavior... regards, tom lane