Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> help about a query
Hi everybody,
Can someone help about this statement,
table: customer, table: sales_order
the question is to retrieve the average amount of all the orders each customer has passed during a quarter of the year 1990...
This is what I have tried :
select c.name, AVG(s.total) "1st Q", AVG(s.total) "2nd Q",
AVG(s.total) "3rd Q", AVG(s.total) "4th Q", from customer c, sales_order s where c.customer_id=s.customer_id AND total IN (select AVG(s.total) from sales_order where order_date BETWEEN ('01-JAN-1990' AND '31-MAR-1990'), ('01-APR-1990' AND '30-JUN-1990'),