list variable attributes in one select - Mailing list pgsql-sql

From Louis-David Mitterrand
Subject list variable attributes in one select
Date
Msg-id 20070122074348.GA8177@apartia.fr
Whole thread Raw
Responses Re: list variable attributes in one select  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
List pgsql-sql
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?



pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Possible to emulate pre-8.2 behaviour of SET CONSTRAINTS?
Next
From: "A. Kretschmer"
Date:
Subject: Re: list variable attributes in one select