vb.net Linq四表联合查询

前端之家收集整理的这篇文章主要介绍了vb.net Linq四表联合查询前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
                       var query = from b in
                            (from a in
                                 (from t1 in MainN join t2 in Sec on t1.MainNo1 equals t2.secondNo1 into lg1 from t2 in lg1.DefaultIfEmpty()
                                  select t1)
                             join td in Third on a.MainNo2 equals td.thirdNo1 into lg2 from td in lg2.DefaultIfEmpty()
                             select a)
                        join f in Four on b.MainNo3 equals f.fourNo1 into lg3 from f in lg3.DefaultIfEmpty()
                        select new { b.Mainid,b.secnondNo2,b.thridNo2,fourNo2 = f == null ? 0 : f.fourNo2 };

猜你在找的VB相关文章