Re: [SQL] SubSelect as a column

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Lars <lars(at)sscsinc(dot)com>
Cc: pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] SubSelect as a column
Date: 2000-02-08 03:33:49
Message-ID: 27709.949980829@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

Lars <lars(at)sscsinc(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Nikolay Mijaylov 2000-02-08 07:30:27 Re: [SQL] SubSelect as a column
Previous Message Lars 2000-02-08 00:54:48 SubSelect as a column

Browse pgsql-sql by date

  From Date Subject
Next Message Nikolay Mijaylov 2000-02-08 07:30:27 Re: [SQL] SubSelect as a column
Previous Message Lars 2000-02-08 00:54:48 SubSelect as a column