On Wed, Aug 09, 2000 at 02:53:45PM +0800, Ang Chin Han wrote:
> The queries making use of these might be rewritten as:
> 1. select min(a) from t_sum; -- same as above,
> -- but we've less rows to scan
> 2. select cnt from t_sum where a = 1 and b = 3;
Sorry, bugfix:
select sum(cnt) from t_sum where a = 1 and b = 3;
since c is not referenced.
> 3. select sum(d * cnt) as sum from t_sum where a = 1 and c > 3;
> 4. select sum(b * cnt) / cnt as avg from t_sum where c = 1;