pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: emils.klotins@gmail.com
Cc: pgsql-sql@postgresql.org
Subject: Re: Outer joins?
Date: Fri, 28 Apr 2006 11:31:10 -0400
Message-ID: <1267.1146238270@sss.pgh.pa.us> (raw)
In-Reply-To: <9dcb6fa40604280623h6f353153y@mail.gmail.com>
References: <9dcb6fa40604280623h6f353153y@mail.gmail.com>

Emils <gnudiff@gmail.com> writes:
> The table structure is:

> object_values
> ==========
> obj_id
> att_id
> value

> namely, each object can have arbitrary number of attributes each of
> them with a value.

> What I want, is a simple table of objects with some of their specific
> attributes, the result should be in form:

> obj_id1   o1att1_value  o1att2_value o1att3_value
> obj_id2   o2att1_value  o2att2_value o2att3_value
> ...

This isn't an outer-join problem, it's a crosstab problem.  Try the
crosstab functions in contrib/tablefunc.

			regards, tom lane



view thread (38+ messages)  latest in thread

Message-ID: <1267.1146238270@sss.pgh.pa.us>
Permalink:  ../1267.1146238270@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1267.1146238270@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, emils.klotins@gmail.com
  Subject: Re: Outer joins?
  In-Reply-To: <1267.1146238270@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox