LinQUnion合并查询连接不同的集合,自动过滤相同项;延迟。即是将两个集合进行合并操作,过滤相同的项

var cities = (from p in mylinq.System_Places

          where p.PID == place

          select p).Union(

          from q in mylinq.System_Places

          where q.Parentid==place

          select q

          );

  

LinQ中的Concat连接查询连接不同的集合,不会自动过滤相同项;延迟。

  (from p in System_Places

     where p.PID == 1010

     select p).Concat(

       from q in System_Places

         where q.Parentid==1010

         select q

         ).Concat(

           from n in System_Places

             where n.Parentid==1010

              select n

   )

  

LinQ中的Intersect相交查询:获取不同集合的相同项(交集),即两集合都出现的项。

  (from c in Bst_System_Places

  select c.CnPlaceName).Intersect(

  from e in Bst_Company_Jobs

  select e.WorkPlace)

  

LinQ中的Except与非查询:排除相交项,即从某集合中排除与另一集合中相同的项,以前集合为主。。。

  (from e in Bst_Company_Jobs

  select e.WorkPlace).Except(

  from c in Bst_System_Places

  select c.CnPlaceName)

  

最新文章

  1. 闲来无聊,研究一下Web服务器 的源程序
  2. TextView字体阴影效果
  3. delphi安装 Tclientsocket, Tserversocket控件
  4. there is no spatial analyst license available or enabled
  5. Quality trimming using Trimmomatic
  6. [Python爬虫] Selenium获取百度百科旅游景点的InfoBox消息盒
  7. POJ 1012 Joseph
  8. 基于selenium的pyse自动化测试框架
  9. AxWebBrowser与WebBrowserU盾登陆时的使用
  10. 利用FSO取得BMP,JPG,PNG,GIF文件信息(大小,宽、高等)
  11. ThreadLocal实现方式&使用介绍---无锁化线程封闭
  12. js 弹出页面传值
  13. Apache RewriteCond RewriteRule 入门和Laravel去掉index.php
  14. 设置session超时
  15. angular.js跨域post解决方案
  16. ubuntu16.04 英文环境安装google chrome
  17. php 类接口继承练习
  18. splay详解(二)
  19. mysql - Truncated incorrect DOUBLE value: 'undefined'
  20. SpringBoot入门最详细教程

热门文章

  1. redis启动异常处理一例
  2. BZOJ1485: [HNOI2009]有趣的数列(卡特兰数+快速幂)
  3. 摘:J2EE开发环境搭建(1)——安装JDK、Tomcat、Eclipse
  4. docker学习3-镜像的基本使用
  5. 微信小程序~用户转发 onShareAppMessage
  6. 《CoderXiaoban团队》实验十 团队作业6:团队项目系统设计改进与详细设计
  7. java技术思维导图(转载)
  8. Python的可变类型和不可变类型?
  9. war包部署到服务器后,如何直接访问,而不需要在地址后面加war包名
  10. 了解一下Elasticsearch的基本概念