Skip site navigation (1) Skip section navigation (2)

weird structure

From: rdg(at)viafractal(dot)com(dot)br
To: pgsql-sql(at)postgresql(dot)org
Cc: rdg(at)viafractal(dot)com(dot)br
Subject: weird structure
Date: 2000-08-24 18:24:11
Message-ID: 200008241824.e7OIOR528066@hub.org (view raw or flat)
Thread:
Lists: pgsql-sql
Hi,

Consider the following tables/fields:
table "person": fields "p_id", "p_name".
table "person_attribute": fields "a_id", "a_name".
table "person_data": fields "d_person_id", "d_attribute_id",
"d_value".

Also consider that a person may not have data related to all possible
attributes.

Using this structure, how could I retrieve in one row with a single
select statement all attributes from a person (showing null to
attributes that were not registered to him)?

Thanks for any suggestion,
--
Renato
Sao Paulo - SP - Brasil
rdg(at)viafractal(dot)com(dot)br


Responses

pgsql-sql by date

Next:From: Stephan SzaboDate: 2000-08-24 18:45:19
Subject: Re: Question on string value expression wildcarding
Previous:From: Steve WamplerDate: 2000-08-24 18:15:42
Subject: Question on string value expression wildcarding

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group