Click here to Skip to main content
15,896,369 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i am new to oracle, how to write a query to select company, year, order type and no.of orders(count)
by year wise and company wise for a company.
Posted
Comments
ArunRajendra 28-Aug-13 2:38am    
Give the table structure.

1 solution

Take below query as hint

SQL
select C.Company_Name, O.Year, O.Order_Type, COUNT(ORDER_ID)
from   ORDER O 
       INNER JOIN COMPANY C ON O.COMPANY_ID = C.COMPANY_ID
GROUP BY O.YEAR, C.COMPANY_NAME, O.ORDER_TYPE
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900