sql 版:SELECT [t0].[OrderID], [t0].[CustomerID], [t0].[EmployeeID], [t0].[OrderDate], [t0].[RequiredDate], [t0].[ShippedDate], [t0].[ShipVia], [t0].[Freight], [t0].[ShipName], [t0].[ShipAddress], [t0].[ShipCity], [t0].[ShipRegion], [t0].[ShipPostalCode], [t0].[ShipCountry]
FROM [Orders] AS [t0]
INNER JOIN [Order Details] AS [t1] ON ([t0].[OrderID] = [t1].[OrderID]) AND ([t0].[OrderID] = [t1].[OrderID])
WHERE ([t0].[OrderID] > @p0) AND ([t0].[EmployeeID] = @p1)

 

 LINQ版:from o in Orders  join   od in OrderDetails on  new {oid= o.OrderID,oeid=o.OrderID} equals new {oid=od.OrderID,oeid=od.OrderID }
where o.OrderID>1000 && o.EmployeeID==5
select o

lambda表达式版:

Orders
   .Join (
      OrderDetails, 
      o => 
        
new  
         {
            oid = o.OrderID, 
            oeid =
o.OrderID
         }, 
      od => 
         new  
        
{
            oid = od.OrderID, 
            oeid = od.OrderID
        
}, 
      (o, od) => 
         new  
         {
            o =
o, 
            od = od
         }
   )
   .Where (temp0 =>
((temp0.o.OrderID > 1000) && (temp0.o.EmployeeID ==
(Int32?)5)))
   .Select (temp0 => temp0.o)

LIQN join on 后跟多个条件的更多相关文章

  1. mysql left join中where和on条件的区别

    left join中关于where和on条件的几个知识点: 1.多表left join是会生成一张临时表,并返回给用户 2.where条件是针对最后生成的这张临时表进行过滤,过滤掉不符合where条件 ...

  2. mysql left join中on后加条件判断和where中加条件的区别

    left join中关于where和on条件的几个知识点: .多表left join是会生成一张临时表,并返回给用户 .where条件是针对最后生成的这张临时表进行过滤,过滤掉不符合where条件的记 ...

  3. Linq→join中指定多个条件

    还是习惯先撸一段SQL * FROM User_Pic P AND P.Guid = R.UserPicGuid ORDER BY PicSize DESC 然后发现Linq中的join不能多条件.. ...

  4. left join on 和where中条件的放置位置

    转自:http://blog.csdn.net/muxiaoshan/article/details/7617533 select * from td  left join (select case_ ...

  5. linq中如何在join中指定多个条件

    public ActionResult Edit(int id) { using (DataContext db = new DataContext(ConfigurationManager.Conn ...

  6. 数据库左连接left join、右连接right join、内连接inner join on 及 where条件查询的区别

    join on 与 where 条件的执行先后顺序: join on 条件先执行,where条件后执行:join on的条件在连接表时过滤,而where则是在生成中间表后对临时表过滤 left joi ...

  7. 性能优化实战-join与where条件执行顺序

    昨天经历了一场非常痛苦的性能调优过程,但是收获也是刻骨铭心的,感觉对sql引擎的原理有了进一步认识. 问题起源于测试人员测一个多条件检索的性能时,发现按某个条件查询会特别慢.对应的sql语句简化为: ...

  8. SQL Fundamentals || 多表查询(内连接,外连接(LEFT|RIGHT|FULL OUTER JOIN),自身关联,ON,USING,集合运算UNION)

    SQL Fundamentals || Oracle SQL语言 一.多表查询基本语法 在进行多表连接查询的时候,由于数据库内部的处理机制,会产生一些“无用”的数据,而这些数据就称为笛卡尔积. 多表查 ...

  9. JOIN从句

    MySQL基础表和数据 -- 5条数据 select * from test_a; -- 8条数据 select * from test_b; 内连接 -- 内连接,join,为inner join的 ...

随机推荐

  1. 学习笔记——观察者模式Observer

    观察者模式,当事件发生时,调用相应观察者的方法进行“通知”.Subject中使用一个数据结构存储需要通知的观察者对象,执行Notify时,执行所有观察者的Update方法.

  2. PAT (Advanced Level) 1098. Insertion or Heap Sort (25)

    简单题.判断一下是插排还是堆排. #include<cstdio> #include<cstring> #include<cmath> #include<ve ...

  3. centos搭建nginx环境

    1.yum install  pcre* 2.wget http://nginx.org/download/nginx-1.7.8.tar.gz 3.tar -zxvf nginx-1.7.8.tar ...

  4. Notice: ob_end_clean() [ref.outcontrol]: failed to delete buffer. No buffer to delete

    解决方法一 @ob_end_clean(); 解决方法二 if(ob_get_contents()) ob_end_clean();

  5. CST 公共生成树

    本实验只讨论CST(公共的生成树) 一.实验前先理解生成树决策的4 个步骤: 二.实验拓扑 1. 实验描述: 由于业务的要求,要有可靠的链路,要对链路实现冗余,但链路的冗余有可能给网络带来广播风暴,重 ...

  6. linux性能优化cpu 磁盘IO MEM

    系统优化是一项复杂.繁琐.长期的工作,优化前需要监测.采集.测试.评估,优化后也需要测试.采集.评估.监测,而且是一个长期和持续的过程,不 是说现在优化了,测试了,以后就可以一劳永逸了,也不是说书本上 ...

  7. TCP/IP Protocol Fundamentals Explained with a Diagram

    最近准备系统学习网络相关的知识,主要学习tcp/ip, websocket 知识. 原文地址:http://www.thegeekstuff.com/2011/11/tcp-ip-fundamenta ...

  8. SDAU课程练习--problemG(1006)

    题目描述 Problem Description The highest building in our city has only one elevator. A request list is m ...

  9. adb not responding. if you'd like to

    在安装genymotion后启动工程报此错误. 解决方案:把其他虚拟机删掉,然后用genymotion新建一个,启动工程OK.

  10. Firebug Console 与命令行全集

    Console API 当打开 firebug (也包括 Chrome 等浏览器的自带调试工具),window 下面会注册一个叫做 console 的对象,它提供多种方法向控制台输出信息,供开发人员调 ...