【发布时间】:2014-07-10 06:01:40
【问题描述】:
我在使用左外连接时遇到问题
我只想要 cj_id(table1 in bd1),其中 c.ref(table1 in bd1) 在 ref(table2 in bd2) 中找不到
所以我可以从 db1 中删除一些具有 cj_id 而不是 ref 的注册表
为此,我正在使用此代码:
var query1 = from a in dbPT.table2
join b in dataB.table1
on a.Ref equals b.ref into c
from x in c.DefaultIfEmpty()
select x.CJ_ID;
我无法让它返回带有 cj_id 的字符串
【问题讨论】:
-
这是什么数据库? SQLServer、PostgreSQL、MySQL、Oracle、其他...?
标签: c# linq left-join outer-join