exclusion query
От | Louis-David Mitterrand |
---|---|
Тема | exclusion query |
Дата | |
Msg-id | 20080922143414.GA1983@apartia.fr обсуждение исходный текст |
Ответы |
Re: exclusion query
Re: exclusion query |
Список | pgsql-sql |
Hi, I've got five related tables: - person_type:id_person_type integertype_fr text - person:id_person integer... - person_to_event:id_person -> personid_person_type -> person_type (e.g: actor, director, producer, ...)id_event -> event - event:id_event integerid_event_type -> event_type... - event_type:id_event_type integertype_fr text To select person_type's used in a certain event_type I have this query: select distinct pt.type from person_type pt natural join person_to_event join event e using (id_event) natural join event_type et where et.type_fr='théâtre'; Now, I'd like to select person_type's _not_ used in a certain particular event (say id_event=219). I can see how to build a quey to that effect, but is there a more obvious, clean, short solution? Something that looks like the above query maybe? Thanks,
В списке pgsql-sql по дате отправления: