select on many-to-many relationship

Поиск
Список
Период
Сортировка
От ssylla
Тема select on many-to-many relationship
Дата
Msg-id 1354011231922-5733696.post@n5.nabble.com
обсуждение исходный текст
Ответы Re: select on many-to-many relationship  (Виктор Егоров <vyegorov@gmail.com>)
Re: select on many-to-many relationship  (Sergey Konoplev <gray.ru@gmail.com>)
Список pgsql-sql
Dear list,

assuming I have the following n:n relationship:

t1:
id_project
1
2

t2:
id_product
1
2

intermediary table:
t3
id_project|id_product
1|1
1|2
2|1

How can I create an output like this:
id_project|id_product1|id_product2
1|1|2
2|1|NULL 



--
View this message in context:
http://postgresql.1045698.n5.nabble.com/select-on-many-to-many-relationship-tp5733696.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.



В списке pgsql-sql по дате отправления:

Предыдущее
От: ssylla
Дата:
Сообщение: output query on many to many relationship into several columns
Следующее
От: David Johnston
Дата:
Сообщение: Re: Using regexp_matches in the WHERE clause