Re: discoverer query
From: <STolochkov_at_kkb.kz>
Date: Thu, 6 Apr 2000 19:38:12 +0700
Message-ID: <8ci0gn$1n0$1_at_mail.nursat.net>
) >=20
Date: Thu, 6 Apr 2000 19:38:12 +0700
Message-ID: <8ci0gn$1n0$1_at_mail.nursat.net>
Hi!
if I get you right
select * from birds
where
(select count(distinct state) from sightings
where birds.species=sightings.species and sighting >= 5
) >=20
something like this in assumption that primary key for sightings is species,sighting,state
-- WBR Sergey Raymond van Daelen <raymond_DOT_van-daelen_at_keygene_DOT_com> сообщил в новостях следующее:38ec52ec_at_nfeed.intouch.net...Received on Thu Apr 06 2000 - 14:38:12 CEST
> Hello,
>
> Can anyone give me some suggestions about the following query which I
would
> like to perform in Discoverer, as I do not find a way to do it (if it is
> possible at all?).
>
> I would like to select a set of objects based on the number of occurences
of
> these objects in another set of objects. I'll give an example:
>
> Suppose I have a databse of species of birds, their number of sightings
> (over a specific time period) in a specific state. Now I would like to
> select those birds that have been sighted at least 5 times (condition
> "sighting >= 5", as datapoint), in at least 20 states (of the 50 or so
that
> have been entered in the database). Using totals in a sheet I could
identify
> the species by simply ooking at the counts. However I would like to have
> only the requested subset in the sheet.
>
> Can anyone give me a hint as to how this can be done?
>
> thanks
>
> Raymond
>
>