This is the select statement I have now...
select distinct(float), count(id) from data_table
where float in
(select distinct(float) from data_table
where (
(sd="ab" and
( float >= 0.000000 and float <= 200000.000000 )))
group by float,sd HAVING (sd = "ab" or (sd = "bc"
What I want is a count of all the floats that are
within the given range *and* have an sd or "ab" or "bc"
but not of those with "cd" The above query doesn't
seem quite right, and the answer's not quit right, but
almost. This is what it returns:
float
-------------------- -----------
30.000000 2
50.000000 2
101.123451 1
101.123451 82
300.000000 6
998.000000 2
The problem is that there are two rows for the
101.123451 float (one for those with sd="ab"
and one for those with sd="bc" I want those
two counts to be one merged count.
Any ideas or advice would be much appreciated!! Thanks!!
select distinct(float), count(id) from data_table
where float in
(select distinct(float) from data_table
where (
(sd="ab" and
( float >= 0.000000 and float <= 200000.000000 )))
group by float,sd HAVING (sd = "ab" or (sd = "bc"
What I want is a count of all the floats that are
within the given range *and* have an sd or "ab" or "bc"
but not of those with "cd" The above query doesn't
seem quite right, and the answer's not quit right, but
almost. This is what it returns:
float
-------------------- -----------
30.000000 2
50.000000 2
101.123451 1
101.123451 82
300.000000 6
998.000000 2
The problem is that there are two rows for the
101.123451 float (one for those with sd="ab"
and one for those with sd="bc" I want those
two counts to be one merged count.
Any ideas or advice would be much appreciated!! Thanks!!