Queries n00b again

Queries n00b again

 

  

I m stock ..
i have one table ORDERDETAILS
with differents field : ORDERID, ITEMID, QUANTITY
Same ORDER ID can appear several timesm, and have same ITEMID ..
the question is :

What is the average number of items ordered in each order ?

ORDERID ITEMID QUANTITY SALE_PRICE
401 310 1 299
402 307 3 16.65
402 303 2 16
403 301 7 22
404 301 1 13
404 302 3 6
404 306 5 2.19
404 305 7 13.42
405 310 1 599

i dont know how to attack the problem

SELECT
FROM
WHERE
GROUP BY ORDERDETAILS.ORDERID



f> i have one table employees
f> with several fields, i want the oldest emplyoee familyname
f> (date_hired)



f> SELECT EMPLOYEES.EMP_FAMILY_NAME , MAX(EMPLOYEES.DATE_HIRED)
f> FROM EMPLOYEES
f> WHERE EMPLOYEES.DATE_RELEASED IS NULL
f> GROUP BY EMPLOYEES.EMP_FAMILY_NAME;


f> this give me several results and the date as well
f> it i snot what iwant i just want one or several (if same date) family
f> name.

f> thanks


f> --------
f> Oracle documentation is here: http://tahiti.oracle.com/pls/tahiti/tahiti.homepage
f> To unsubscribe: send a blank email to oracledba-[Email Address Removed] To subscribe: send a blank email to oracledba-[Email Address Removed] Visit the list archive: http://www.LAZYDBA.com/odbareadmail.pl
f> Tell yer mates about http://www.farAwayJobs.com
f> By using this list you agree to these terms:http://www.lazydba.com/legal.html

Oracle LazyDBA home page