Joining several rows into only one

From: JORGE MALDONADO <jorgemal1960(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Joining several rows into only one
Date: 2012-11-28 18:33:15
Message-ID: CAAY=A79L1zaxcSoCUzssHogoezEneWA=ZUEu3veHLk86K-EG_g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I have a SELECT statement that gives me a result like this:

SONG ARTIST
-----------------------------------
Song1 Artist1
Song1 Artist2
Song1 Artist3
Song2 Artist2
Song3 Artist4
Song4 Artist1
Song5 Artist4

As you can see, the same song may belong to more than one artist, and this
is fine. What I would like to do is NOT to get several rows, one for each
different artist, but to join all of the artists in one column and display
only one row.
Is this possible?

Respectfully,
Jorge Maldonado

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Jonathan S. Katz 2012-11-28 18:37:01 Re: Joining several rows into only one
Previous Message Sergey Konoplev 2012-11-28 00:27:21 Re: select on many-to-many relationship