List与表的连接查询

Posted wangzuofei

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了List与表的连接查询相关的知识,希望对你有一定的参考价值。

categoryList.ForEach(p => p.Description = "-1");
                var zpclist = from t in categoryList
                              let tp = (from p in categoryList.Select(s => s.ParentRowGuid) select p)
                              where !tp.Contains(t.RowGuid)
                              select t;
                string projectRowGuid = zpclist.FirstOrDefault().ProjectRowGuid;

                var joined = from g in zpclist
                             join e in dc_DocData.BidSectionShareDocumentEFile.Where(p => p.ProjectRowGuid == projectRowGuid)
                             on g.RowGuid equals e.ParentRowGuid into ge
                             select new { g, ge };
                foreach(var j in joined)
                {
                    if (j.ge.Count() > 0)
                    {
                        j.g.Description = "1";
                    }
                    else
                    {
                        j.g.Description = "0";
                    }
                }

  

以上是关于List与表的连接查询的主要内容,如果未能解决你的问题,请参考以下文章

oracle的多表查询与表的连接

Atitit 数据库视图与表的wrap与层级查询规范

Hibernate的HQL多表查询

46表与表的连接

CD库查询练习

连表查询