Re: Creating Views with Column Names based on Distinct

From: Frank Bax <fbax(at)sympatico(dot)ca>
To: Damien Dougan <damien(dot)dougan(at)mobilecohesion(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Creating Views with Column Names based on Distinct
Date: 2003-06-09 14:13:01
Message-ID: 5.2.1.1.0.20030609100829.026126c0@pop6.sympatico.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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'.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Alexey Dashevsky 2003-06-09 14:21:03 left join in cursor
Previous Message Tom Lane 2003-06-09 14:06:16 Re: "Join" on delimeter aggregate query