0

I am using asp.net mvc 5 , Entity framework 5,

i have following tables:

1. orderid customerid 
      1          2
      2          3
      3          1

orderid   productname   quantity
   1        A                    10
   1        B                    15
   1        C                    20

i.e I want to make a report like following:

Total Quantity per customer:

                   total          total       total
                   Qty for        Qty for    Qty for

productname customer1 customer2 customer3
1.......................2.............3.............33
2.......................3.............2.............24
3.......................4.............22............34

i am using asp.net mvc 5, entity framework 5 ,linq

Edited by sadaquat_1

2
Contributors
1
Reply
9
Views
2 Years
Discussion Span
Last Post by pritaeas
0

What do you need? A SQL query or LINQ?

SQL would be something like this:

SELECT P.ProductName, O.CustomerId, SUM(P.Quantity)
FROM Product P, Order O
WHERE P.OrderId = O.OrderId
GROUP BY P.ProductName, O.CustomerId
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.