Mahesh S wrote:
well, i think i ahvent explained clearly..
consider this table
timestamp value
2005/07/08 6
2005/07/09 7
2005/07/10 8
2005/07/11 6
i would like to calculate the percentage of the a value occuring
between 5 and 7 between two dates?
SELECT SUM(CASE WHEN value BETWEEN 5 AND 7 THEN 1.0 END)/ COUNT(1)
FROM T WHERE timestamp BETWEEN ? AND ?
That ought to do it.
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab