> 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?
I wanted
Max $500
Min $20
Avg $276
The trouble of course is that these values are already operated upon
by sum in the group.
-Michael
_________________________________________________________________ http://fastmail.ca/ - Fast Free Web Email for
Canadians