pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kaare Rasmussen <kar@webline.dk>
To: PostgreSQL-SQL <pgsql-sql@postgresql.org>
Subject: 7.1 feature?
Date: Thu, 28 Dec 2000 16:44:19 +0100
Message-ID: <00122816441901.00780@bering> (raw)

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



view thread (2+ messages)  latest in thread

Message-ID: <00122816441901.00780@bering>
Permalink:  ../00122816441901.00780@bering/
Also on:    postgresql.org/message-id/00122816441901.00780@bering

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: kar@webline.dk
  Subject: Re: 7.1 feature?
  In-Reply-To: <00122816441901.00780@bering>
  References: <00122816441901.00780@bering>

* 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