list variable attributes in one select

Поиск
Список
Период
Сортировка
От Louis-David Mitterrand
Тема list variable attributes in one select
Дата
Msg-id 20070122074348.GA8177@apartia.fr
обсуждение исходный текст
Ответы Re: list variable attributes in one select
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Possible to emulate pre-8.2 behaviour of SET CONSTRAINTS?
Следующее
От: "A. Kretschmer"
Дата:
Сообщение: Re: list variable attributes in one select