Re: Creating Views with Column Names based on Distinct - Mailing list pgsql-sql

From Frank Bax
Subject Re: Creating Views with Column Names based on Distinct
Date
Msg-id 5.2.1.1.0.20030609100829.026126c0@pop6.sympatico.ca
Whole thread Raw
In response to Creating Views with Column Names based on Distinct Row Data  (Damien Dougan <damien.dougan@mobilecohesion.com>)
Responses Re: Creating Views with Column Names based on Distinct
List pgsql-sql
At 10:59 AM 6/6/03, Damien Dougan wrote:
>I was wondering if it is possible to create a table view based on a table
>which is effectively an "attribute list".
>
>For example, suppose I have two tables:
>
>CREATE TABLE user
>(
>   userid integer,
>   username character varying,
>   userpassword character varying,
>   startdate date
>);
>
>CREATE TABLE userdetail
>(
>   userid integer,
>   attributename character varying,
>   attributevalue character varying
>);
>
>Now I want to make a public view of the user, which would have all of the
>defined fields in user, and all of the defined attributes across userdetail.


I'll think you'll find what you're looking for if you search the archives 
of this mailing list for 'crosstab'.  



pgsql-sql by date:

Previous
From: "James Taylor"
Date:
Subject: Coalesce/Join/Entries may not exist.
Next
From: Tom Lane
Date:
Subject: Re: Column limits in table/ views