8) Rerun the same report and give me numbers for 2014 and 2015 for each the three companies. Order it by year and then highest to lowest number of orders within each year.
SELECT count(orders.orderid)
, customers.companyname
, to_char(orders.orderdate, 'Y') as Year
FROM northwinds.orders
JOIN northwinds.customers
ON customers.customerid = orders.customerid
JOIN northwinds.orderdetails
ON orderdetails.orderid = orders.orderid
WHERE orders.orderdate between '1-JAN-14' and '31-DEC-15'
AND customers.companyname = 'Rattlesnake Canyon Grocery'
OR customers.companyname= 'Around the Horn'
OR customers.companyname='Island Trading'
GROUP
BY customers.companyname
AND to_char(orders.orderdate, 'Y')
ORDER
BY count(orders.orderid) DESC
, to_char(orders.orderdate, 'Y')
;
When I run this, I receive the error:
Error: [Oracle][ODBC][Ora]ORA-00933: SQL command not properly ended