Hi all,
This is my table (simplificated)
cr1 cr2
elt1 2 3
elt2 5 5
elt3 7 4
elt4 9 1
...
For each criteria (cr) I have a constant gate, and i'd like to count the number of elements exceeding the 2 gates, the number over one and not the other and finally the number under these gates.
In fact my application is graphical, each point or element is placed on the graphical with cr1 against cr2, and I'd like to count the number of points in each part of the graphical.
Note: data.typeid are the criteria cr1 & cr2
7 and 10 are my gates.
This is the beginning of my query:
---------------------------------------------------------
SELECT COUNT (*) AS UNSTRUCTURED
FROM data INNER JOIN elements ON data.ownerid=elements.id
WHERE (data.typeid=19 AND data.value>7) AND data.ownerid IN
(SELECT data.ownerid FROM data WHERE (data.typeid=18 AND data.value<=10)
AND elements.typeid=4);
---------------------------------------------------------
Here is one count, I use a UNION to get the 4 numbers but my result is one column and I'd like to catch a row in order to make a graphical analysis with Access.
thanx for your help if you have any idea about catching one row or improving the performance of my query...
This is my table (simplificated)
cr1 cr2
elt1 2 3
elt2 5 5
elt3 7 4
elt4 9 1
...
For each criteria (cr) I have a constant gate, and i'd like to count the number of elements exceeding the 2 gates, the number over one and not the other and finally the number under these gates.
In fact my application is graphical, each point or element is placed on the graphical with cr1 against cr2, and I'd like to count the number of points in each part of the graphical.
Note: data.typeid are the criteria cr1 & cr2
7 and 10 are my gates.
This is the beginning of my query:
---------------------------------------------------------
SELECT COUNT (*) AS UNSTRUCTURED
FROM data INNER JOIN elements ON data.ownerid=elements.id
WHERE (data.typeid=19 AND data.value>7) AND data.ownerid IN
(SELECT data.ownerid FROM data WHERE (data.typeid=18 AND data.value<=10)
AND elements.typeid=4);
---------------------------------------------------------
Here is one count, I use a UNION to get the 4 numbers but my result is one column and I'd like to catch a row in order to make a graphical analysis with Access.
thanx for your help if you have any idea about catching one row or improving the performance of my query...