subquery with more than one column

Поиск
Список
Период
Сортировка
От Raimon Fernandez
Тема subquery with more than one column
Дата
Msg-id 6506B613-A727-4BA1-BC59-6B48E5666A7D@montx.com
обсуждение исходный текст
Ответ на oid or without oid ...  (Raimon Fernandez <coder@montx.com>)
Ответы Re: subquery with more than one column  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: "Josh Tolley"
Дата:
Сообщение: Re: Update with aggregate subquery?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: subquery with more than one column