Re: [SQL] Append n Rows into a Single Row

2011-06-18 Thread Samuel Gendler
Actually, you need the array_agg() function to aggregate multiple rows into a single array, and that is discussed on the aggregate functions page, here: http://www.postgresql.org/docs/9.0/static/functions-aggregate.html You could then use one of the other array functions to manipulate that array.

Re: [SQL] Append n Rows into a Single Row

2011-06-18 Thread Rob Sargent
Look at the array aggregation functions here Tripura wrote: Hi, I am totally new to PostgreSQL and this is my first script. Can anyone please help me with my following requirement I have script that returns 1 column and 40 row

Re: [SQL] Append n Rows into a Single Row

2011-06-18 Thread Samuel Gendler
Look at the documentation for the tablefunc contrib module. It provides a crosstab() function which will allow you to pivot multiple rows into multiple columns in a single row, with all rows that share a particular key in one or more columns pivoting up into the same row, but different keys endi

[SQL] Append n Rows into a Single Row

2011-06-18 Thread Tripura
Hi, I am totally new to PostgreSQL and this is my first script. Can anyone please help me with my following requirement I have script that returns 1 column and 40 rows. My requirement is update this existing script to show all the 40 rows data in a single row as a string. For example The curre