I m试图将以下T-SQL问题转换为linq2sql。 无论我做什么,它还是把它转化为一些新生事物,并加入其中。 任何建议?
表A、B、C
SELECT A.Id, A.Name, Pool.Total
FROM A
INNER JOIN B ON A.Id = B.AId
LEFT JOIN (
SELECT AId,
SUM(Quantity) as Total
FROM C
GROUP BY AId) AS Pool ON A.Id = C.AId
WHERE Pool.Total < B.Threshold