Re: Table like a field

From: Richard Huxton <dev(at)archonet(dot)com>
To: lucas(at)presserv(dot)org
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Table like a field
Date: 2005-03-09 14:19:45
Message-ID: 422F0601.70103@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

lucas(at)presserv(dot)org wrote:
> Hello.
> Is there any way to build a table that contain the coluns name for the other
> table fields? like this:
>
> create table people(id serial primary key, name varchar(50) );
> create table people_fields ( field_name varchar(30) );
> insert into people_fields values ('occupation');
> insert into people_fields values ('address');
>
> then I create any function or view to get:
> SELECT * FROM people; //may return
>
> id - name - | ocuppation - address |

You'll want to search the mailing-list archives for "crosstab", and also
look in the contrib/ section of the source distribution.

--
Richard Huxton
Archonet Ltd

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Bruno Wolff III 2005-03-09 14:26:11 Re: order by question
Previous Message Bruno Wolff III 2005-03-09 14:19:08 Re: interval +variable