COUNT(*) to find records which have a certain number of dependencies ?

Поиск
Список
Период
Сортировка
От T E Schmitz
Тема COUNT(*) to find records which have a certain number of dependencies ?
Дата
Msg-id 414EF3E6.9040202@numerixtechnology.de
обсуждение исходный текст
Ответы Re: COUNT(*) to find records which have a certain number of dependencies ?  (Greg Stark <gsstark@mit.edu>)
Список pgsql-sql
Hello,

I apologize in advance for this garbled message but I've been banging my 
head against a brick-wall for a while and I just can't figure how to do 
the following:

I have 3 tables BRAND,MODEL,TYPE which are related to each other:

BRAND
=====
BRAND_PK
BRAND_NAME

MODEL
=====
MODEL_PK
MODEL_NAME
BRAND_FK (NOT NULL, references BRAND_PK)

TYPE
====
TYPE_PK
TYPE_NAME
MODEL_FK (NOT NULL, references MODEL_PK)

------------------------------------

I want to select only those BRAND/MODEL combinations, where the MODEL 
has more than one TYPE, but only where one of those has TYPE_NAME='xyz'.
I am not interested in MODELs with multiple TYPEs where none of them are 
called 'xyz'.


-- 


Regards/Gruß,

Tarlika Elisabeth Schmitz


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

Предыдущее
От: Theodore Petrosky
Дата:
Сообщение: Re: How to check postgres running or not ?
Следующее
От: T E Schmitz
Дата:
Сообщение: Re: COUNT(*) to find records which have a certain number of