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

python - Overwriting the save method of a Django model -

java - how to browse all messages from 2 different MQQueue in the same function? -

How to run C# code using mono without Xamarin in Android? -