Top Frequency query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am developing a database where I need to find data in a table that occurs
in every sample that is analyzed. For example, Bug1 is in every sample
analyzed but in low numbers, while Bug2 is in some of the samples but in
great numbers when it is there. I want to be able to pull Bug1 out and list
it and skip Bug2. Is this at all possible?
 
Not much detail there on your table structure.

You need a count of Samples and a count of Samples with Bug1 in them

Do you have a separate table of Samples and another of Bugs in Samples?

SELECT BugInSample.Bugs
FROM BugInSample
Having Count(BugInSample.Bugs) = DCount("*","Sample")
GROUP BY BugInSample.Bugs
 
The structure of my tables is:
I have a table that contains the "main" information that is called TaxaInfo.
It has 7 fields that store the sample number, the link back to the sample
table, the genera number, linking to the generic information, the species
number, linking back to species information and the number found. What I
have envisioned is to look through this table and for each project, found in
the Sample table and linked by SampleNo, find the taxa, a combination of both
genera and species, that are found in every, or almost every sample. It is
confusing I know and perhaps is why I am having difficulty wrapping my mind
around this.
 
Back
Top