Re: subquery with more than one column

From: Raimon Fernandez <coder(at)montx(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: subquery with more than one column
Date: 2007-07-05 20:51:37
Message-ID: 989D18C1-AF52-4AFE-8581-2B988B457DA4@montx.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

but I want as a separate columns, like a normal SELECT ...

this is what I get:

+---------------+
| row |
+---------------+
| (1,"ref rai") |
| (1,ref) |
+---------------+

thanks,

raimon

On 05/07/2007, at 21:30, Tom Lane wrote:

> Raimon Fernandez <coder(at)montx(dot)com> writes:
>> It's not possible to return in a subquery more than one column ?
>
> Try it like this:
>
> SELECT id_intern, (SELECT ROW(referencia, descripcio) FROM
> articles WHERE...
>
> regards, tom lane
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org
>

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Jon Sime 2007-07-05 21:27:48 Re: subquery with more than one column
Previous Message Tom Lane 2007-07-05 20:35:29 Re: Postgres not using indices defined on my table with certain queries using "in"