Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 2E4C79FA6B8 for ; Mon, 22 Jan 2007 03:43:56 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 91746-07 for ; Mon, 22 Jan 2007 03:43:51 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from zenon.apartia.fr (zenon.apartia.fr [82.66.93.83]) by postgresql.org (Postfix) with ESMTP id E42749FA356 for ; Mon, 22 Jan 2007 03:43:52 -0400 (AST) Received: from styx.apartia.fr (styx.apartia.fr [10.0.3.109]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "styx.apartia.fr", Issuer "ca.apartia.fr" (verified OK)) by zenon.apartia.fr (Postfix) with ESMTP id 015DBF081E917 for ; Mon, 22 Jan 2007 08:43:48 +0100 (CET) Received: by styx.apartia.fr (Postfix, from userid 1000) id CC507B2AD43F; Mon, 22 Jan 2007 08:43:48 +0100 (CET) Date: Mon, 22 Jan 2007 08:43:48 +0100 From: Louis-David Mitterrand To: pgsql-sql@postgresql.org Subject: list variable attributes in one select Message-ID: <20070122074348.GA8177@apartia.fr> Mail-Followup-To: pgsql-sql@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.13 (2006-08-11) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200701/96 X-Sequence-Number: 27248 Hello, I've got the following tables: person: - id_person - firstname - lastname - type person_to_type: - id_person references person - type references person_type; person_type: - type "person_type" contains differents caracteristics for a person (actor, director, author, etc.) who can have several types, hence the need for the person_to_type table. I'd like to know if I can list in one SELECT command a person and all of its types, given that the number of types can be 0 to n. For example, for a given person I'd like to obtain: "John Doe", "actor", "playright", "author" or "Jane Doe", "director" in one select. Is that possible?