我有三个桌子
device (id,device_name)
operation (id,type"Sell,Add to Store")
operation_device (id,operation_id,device_id,Quantity)
我想知道销售最多的设备(名称+数量)
var q = from s in db.device_operation
join k in db.operation
on s.operationId equals k.Id
where k.type == "Sell"
group s by s.deviceId into g
select g.Sum(s => s.Quantity);