【问题标题】:left outer join from different database来自不同数据库的左外连接
【发布时间】: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


【解决方案1】:

你能在这里看到吗Joining Two Entity Sets from Different Contexts 连接是在服务器端完成的,如果你使用不同的服务器,你就无法做到这一点

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-06-21
    • 2018-02-06
    • 1970-01-01
    • 1970-01-01
    • 2014-10-05
    • 2014-02-26
    • 2013-11-11
    • 1970-01-01
    相关资源
    最近更新 更多