From: Tom Lane <tgl@sss.pgh.pa.us>
To: Lars <lars@sscsinc.com>
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] SubSelect as a column
Date: Mon, 07 Feb 2000 22:33:49 -0500
Message-ID: <27709.949980829@sss.pgh.pa.us> (raw)
In-Reply-To: <Pine.BSF.4.10.10002071642050.53230-100000@maximillion.sscsinc.com>
References: <Pine.BSF.4.10.10002071642050.53230-100000@maximillion.sscsinc.com>
Lars <lars@sscsinc.com> writes:
> I am trying to use a subselect as a column name, but it appears as if this
> is not supported in Postgresql. Here is the query:
> SELECT u.idnum, u.username,
> (SELECT COUNT(t.techid)
> FROM ticket t
> WHERE t.techid = u.idnum)
> FROM users u;
Nope, doesn't work in 6.5.*. It is there in current sources for the
upcoming 7.0 release. Can't think of any good workaround in 6.5...
regards, tom lane
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: tgl@sss.pgh.pa.us, lars@sscsinc.com
Subject: Re: [SQL] SubSelect as a column
In-Reply-To: <27709.949980829@sss.pgh.pa.us>
References: <Pine.BSF.4.10.10002071642050.53230-100000@maximillion.sscsinc.com> <27709.949980829@sss.pgh.pa.us>
* 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