Re: [SQL] SubSelect as a column - Mailing list pgsql-sql

From Tom Lane
Subject Re: [SQL] SubSelect as a column
Date
Msg-id 27709.949980829@sss.pgh.pa.us
Whole thread Raw
In response to SubSelect as a column  (Lars <lars@sscsinc.com>)
List pgsql-sql
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


pgsql-sql by date:

Previous
From: Marten Feldtmann
Date:
Subject: Re: [SQL] Re: [HACKERS] Proposed Changes to PostgreSQL
Next
From: Patrick JACQUOT
Date:
Subject: Re: [SQL] SubSelect as a column