Received: from rush.u-netsys.com.br (rush.u-netsys.com.br [200.192.48.10]) by hub.org (8.10.1/8.10.1) with SMTP id e7OIOR528066 for ; Thu, 24 Aug 2000 14:24:28 -0400 (EDT) Message-Id: <200008241824.e7OIOR528066@hub.org> Received: (qmail 14364 invoked from network); 24 Aug 2000 18:24:11 -0000 Received: from vaughan.u-netsys.com.br (HELO Debug) (200.192.48.5) by rush.u-netsys.com.br with SMTP; 24 Aug 2000 18:24:11 -0000 To: pgsql-sql@postgresql.org Cc: rdg@viafractal.com.br From: rdg@viafractal.com.br Subject: weird structure Date: Thu, 24 Aug 2000 18:24:11 GMT X-Mailer: U-Net Mail X-Archive-Number: 200008/266 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@viafractal.com.br