Combining data in different rows?

From: Anthony Masinton <amasinton(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Combining data in different rows?
Date: 2007-01-02 19:33:14
Message-ID: 9C5B21BB-866F-487D-A335-215C7AC52617@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I would like to combine data from different rows in one column into
one row.

I have two tables: 'locations' containing a dozen records about
cities and their geographic coodinates - the other table,'testators',
contains several hundred records referring to wills (each will is
given a unique number) made by people in each of the towns in the
locations table.

I would like to query both tables so that a table is produced that
has one row for each of the dozen cities and in each row is the name
of the city, its coordinates and then a column containing all of the
wills (i.e. the unique identifying number of each) from that city.

Is this possible and if so, how?

Thanks!
-- Anthony Masinton

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2007-01-02 20:05:44 Re: Combining data in different rows?
Previous Message Ben 2007-01-02 19:17:16 Re: Geographical redundancy