Search Postgresql Archives

Re: SELECT query experts, anyone?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

<<attachment: smime.p7s>>


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux