问题描述
首先 我有一个slq查询;
First of all i have a slq query;
从订单中选择CompanyID,CompanyName,ProductID,Count(*)作为numberOfOrders
加入公司Ordesr.FirmaID = Companies.id
加入产品Ordesr.ProductID = Products.id groupID,CompanyName,ProductName
Select CompanyID,CompanyName, ProductID, Count(*) as numberOfOrders
from Orders
join companies on Ordesr.FirmaID= Companies.id
join Products on Ordesr.ProductID= Products.id group by CompanyID,CompanyName,ProductName
但我不知道请帮助我...
but I don't have any idea please help me...
推荐答案
选择CompanyID,CompanyName,ProductID,Count(*)作为numberOfOrders
来自订单
加入公司在Ordesr.FirmaID = Companies.id
加入Ordesr.ProductID上的产品= Products.id 按公司ID,公司名称,产品名称分组
Select CompanyID,CompanyName, ProductID, Count(*) as numberOfOrders
from Orders
join companies on Ordesr.FirmaID= Companies.id
join Products on Ordesr.ProductID= Products.id group by CompanyID,CompanyName,ProductName
但我不知道请帮帮我......
but I don't have any idea please help me...
这篇关于SQL到LINQ的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!