subquery with more than one column - Mailing list pgsql-novice

From Raimon Fernandez
Subject subquery with more than one column
Date
Msg-id 6506B613-A727-4BA1-BC59-6B48E5666A7D@montx.com
Whole thread Raw
In response to oid or without oid ...  (Raimon Fernandez <coder@montx.com>)
Responses Re: subquery with more than one column
List pgsql-novice
Hi,


It's not possible to return in a subquery more than one column ?

SELECT id_intern, (SELECT referencia, descripcio FROM articles WHERE
id_intern = product_blister.id_product_added) FROM product_blister
WHERE id_product_source = '8';


so, I would have to add a new subquery for each column I want to
retrieve ?


like this:

SELECT id_intern, (SELECT referencia FROM articles WHERE id_intern =
product_blister.id_product_added),(SELECT descripcio FROM articles
WHERE id_intern = product_blister.id_product_added) FROM
product_blister  WHERE id_product_source = '8';


all of them are from the same table ...


regards,


raimon fernandez




pgsql-novice by date:

Previous
From: "Josh Tolley"
Date:
Subject: Re: Update with aggregate subquery?
Next
From: Tom Lane
Date:
Subject: Re: subquery with more than one column