Received: from bering.webline.dk (83.adsl0.kh.worldonline.dk [213.237.10.83]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eBSFiEL13723 for ; Thu, 28 Dec 2000 10:44:14 -0500 (EST) (envelope-from kar@webline.dk) Received: from localhost (localhost [[UNIX: localhost]]) by bering.webline.dk (8.10.2/8.10.2/SuSE Linux 8.10.0-0.3) id eBSFiJ801343 for pgsql-sql@postgresql.org; Thu, 28 Dec 2000 16:44:19 +0100 From: Kaare Rasmussen Date: Thu, 28 Dec 2000 16:44:19 +0100 X-Mailer: KMail [version 1.1.99] Content-Type: text/plain; charset="iso-8859-1" To: PostgreSQL-SQL Subject: 7.1 feature? MIME-Version: 1.0 Message-Id: <00122816441901.00780@bering> Content-Transfer-Encoding: 8bit X-Archive-Number: 200012/278 X-Sequence-Number: 615 I need to do something like this: SELECT n.name FROM (SELECT p.contact_seq AS contact_seq, p.lastname||', '||p.firstname AS name FROM person p UNION SELECT co.name AS name FROM company co) n; Of course there's more; this is cut from the original select. But PostgreSQL complains about SELECT (i guess it's the SELECT in the subquery) In the dox I read: A FROM item can also be a parenthesized sub-SELECT (note that an alias clause is required for a sub-SELECT!). This is an extremely handy feature since it's the only way to get multiple levels of grouping, aggregation, or sorting in a single query. Is this a 7.1 feature? Or is my typing wrong? And will 7.1 support unions in subselects like above? -- Kaare Rasmussen --Linux, spil,-- Tlf: 3816 2582 Kaki Data tshirts, merchandize Fax: 3816 2501 Howitzvej 75 Åben 14.00-18.00 Email: kar@webline.dk 2000 Frederiksberg Lørdag 11.00-17.00 Web: www.suse.dk