On Mon, 11 Jun 2001, Michael Richards wrote:
> I run a select sum(amount) from payments group by userid
> userid | sum
> --------------
> 1 | $500
> 2 | $310
> 3 | $20
>
> I need to modify this query so it returns the minimum, maximum and
> average sums. Is there any way I can do this?
select sum(amount),min(amount),max(amount) from payments group by userid
Is that what you mean? Or you want min/max _not_ to be grouped by userid?