mysql - displaying revenue for each year -


i'm using northwind sql database. not familiar, has of following tables:

 orders,   orderdetails,   products,    categories   (orders.orderid = orderdetails.orderid)   (products.productid = orderdetails.productid)  (categories.categoryid = products.categoryid)   orders has column named "orderdate" (formatted dd/mm/yy)  orderdetails has column named "price" 

i need display total "revenue" each year. is, sum of "prices". idea how so?

try this, don't have complete table structure. way of group mysql

   select sum (od.price) revenue orderdetails od     inner join orders o on orders.orderid = orderdetails.orderid     group year(o.orderdate); 

Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -