Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> help about a query

help about a query

From: wajim <wajim29_at_hotmail.com>
Date: Mon, 23 Jul 2007 19:06:38 -0700
Message-ID: <1185242798.149108.62280@m3g2000hsh.googlegroups.com>


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'),

('01-JUL-1990' AND '3-SEP-1990')
('01-OCT-1990' AND '31-DEC-1990');
Can you help, PLZ?? Received on Mon Jul 23 2007 - 21:06:38 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US