Re: SELECT query experts, anyone?

Поиск
Список
Период
Сортировка
От Tino Wildenhain
Тема Re: SELECT query experts, anyone?
Дата
Msg-id 48AC17CE.5030604@wildenhain.de
обсуждение исходный текст
Ответ на SELECT query experts, anyone?  ("Teemu Juntunen" <teemu.juntunen@e-ngine.fi>)
Список pgsql-general
Teemu Juntunen wrote:
> Hi Experts,
>
> is threre any way to SELECT values in columns instead of rows? For
> example select products and their manufacters in the followin way:
>
> product1; manufacturer1; manufacturer2;,,, manufacturerN
> product2; manufacturer3;
> product3; manufacturer1;.. manufacturerN-1
>
> With a function you could put the product manufacturers in one string,
> but I would like to have them in columns.
>
> How about arrays. Is there a way to SELECT values in an array to columns?

This should work:

SELECT product,array(SELECT manufacturer FROM manufacturers WHERE
manufacturer_id=products.manufacturer_id) WHERE ...

or something along the lines of the above.

Regards
Tino

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: 8.3.3 win32 crashing
Следующее
От: "Kevin Grittner"
Дата:
Сообщение: Re: [ADMIN] Regarding access to a user