From: T E Schmitz <mailreg@numerixtechnology.de>
To: pgsql-sql <pgsql-sql@postgresql.org>
Subject: COUNT(*) to find records which have a certain number of dependencies ?
Date: Mon, 20 Sep 2004 16:14:46 +0100
Message-ID: <414EF3E6.9040202@numerixtechnology.de> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: mailreg@numerixtechnology.de
Subject: Re: COUNT(*) to find records which have a certain number of dependencies ?
In-Reply-To: <414EF3E6.9040202@numerixtechnology.de>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox