C# 需要在linq中写入2个外部联接
我需要使用linq编写以下查询。非常感谢您的帮助C# 需要在linq中写入2个外部联接,c#,linq,C#,Linq,我需要使用linq编写以下查询。非常感谢您的帮助 select r1.rID, name, uName, 001 aID, nvl(uValue, 0) uValue from r1, r2, l where r1.rID = r2.rID and r1.rID = l.rID(+) and 001 =
select
r1.rID,
name,
uName,
001 aID,
nvl(uValue, 0) uValue
from
r1,
r2,
l
where
r1.rID = r2.rID
and r1.rID = l.rID(+)
and 001 = l.aID(+)
order by
r1.rID
应该是这样的:
var result = (from r1 in db.r1
join r2 in db.r2 on r1.rID equals r2.rID
join l in db.l on r1.rID equals l.rID
where l.aID == "001"
orderby r1.rID
select new {
rID = r1.rID,
Name = r1.name,
UName = r1.uName,
aID = "001",
UValue = nvl(r.uValue)
}).ToList();
所以就这样做吧,或者雇佣一个程序员,“(+)”是“外部连接”的一种神谕方式。它们在C#/LINQ中没有意义