Merging rows into one result?

From: "Jesper K(dot) Pedersen" <jkp(at)solnet(dot)homeip(dot)net>
To: pgsql-sql(at)postgresql(dot)org
Subject: Merging rows into one result?
Date: 2006-03-11 16:31:33
Message-ID: 20060311173133.1358a018@io.solnet
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Is it possible to use SQL to merge data into one result?

A theorethical example to explain:

tbl_test (
id integer,
information varchar(25))

id | information
---+--------------
1 | Yo
2 | Go away
1 | Stay put
3 | Greetings

Please note id is not unique and not a primary key.

and I wonder if there is any functions to "merge" data (sort of
concat'ing).
A normal: select information from tbl_test where id=1
would result in the rows
Yo
Stay put

I would like a single row result in the format of:
Yo Stay put

Any ideas on this?

Best regards
Jesper K. Pedersen

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Andreas Kretschmer 2006-03-11 16:43:37 Re: Merging rows into one result?
Previous Message PFC 2006-03-11 11:29:14 Re: [SQL] input from a external text file......!