views:

131

answers:

1

Hi again,

I have a PostgreSQL table that looks like this:

A -> B
A -> C
A -> G
A -> H
B -> O
B -> K

Where "->" separates two columns where the first points to the second (hyperlinks). Now I would like to take all distinct values in the first column and assign them an ARRAY containing all values to which they point to in the second column, thereby reducing index size and help me get closer to where I wish to get.

Hence, I wish to ARRAYify a single columned result set of [many] rows. If I could call a function like arrayify(SELECT column2 FROM table WHERE column1 = 'A') that would make my life so easy.

Anyone or anymany knows?

Thx

+2  A: 

Check this out

http://hype-free.blogspot.com/2008/05/converting-rows-records-to-and-from.html

cmsjr
Awesome link; thx!
Nicholas Leonard