Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Aggregation stumper
select customer
from customer_order
group by customer
having count(*) < 3 and sum(order_amount) > 2000
--
Terry Dykstra [TeamPS]
Canadian Forest Oil Ltd.
maxmike_at_ibx.bc.ca wrote in message <6jhpqg$bfi$1_at_nnrp1.dejanews.com>...
>
>
>I believe the following is not directly expressible in a single query:
>
>"Customer names for customers that have at most 3 orders with the
>average of order amounts greater than 2000"
>
>In other words I need the average of the counted orders.
>
>I'd love to be shot down in my belief! Any ideas?
>
>-----== Posted via Deja News, The Leader in Internet Discussion ==-----
>http://www.dejanews.com/ Now offering spam-free web-based newsreading
Received on Fri May 15 1998 - 13:02:06 CDT