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. HDU - 5234 Happy birthday

    Problem Description Today is Gorwin’s birthday. So her mother want to realize her a wish. Gorwin say ...

  2. ubuntu server 11.10 安装 oracle 10g XE

    1.将配置的Oracle源服务器的公钥添加在本地 apt 系统的密钥库中: wget http://oss.oracle.com/el4/RPM-GPG-KEY-oraclesudo apt-key  ...

  3. 百度地图移动版API 1.2.2版本(Android)地图偏移的最佳解决办法

    Import import com.baidu.mapapi.CoordinateConvert;import com.baidu.mapapi.GeoPoint; Code GeoPoint p = ...

  4. 二分图最大匹配 Hopcroft-Karp算法模板

    #include <iostream> #include <cstdlib> #include <cstdio> #include <cstring> ...

  5. C#中:函数访问级别对函数形参访问级别的约束

    Inconsistent accessibility: parameter type 'Program.CommandLineInfo' is less accessible than method ...

  6. source.list

    deb http://www.anheng.com.cn/debian/ squeeze maindeb-src http://www.anheng.com.cn/debian/ squeeze ma ...

  7. islands打炉石传说<DP>

    islands最近在完一款游戏"炉石传说",又名"魔兽英雄传".炉石传说是一款卡牌类对战的游戏.游戏是2人对战,总的来说,里面的卡牌分成2类,一类是法术牌,另一 ...

  8. 转:Visual Studio进行Web性能测试- Part I

    原文作者:Ambily.raj Visual Studio是可以用于性能测试的工具之一.Visual Studio Test版或Visual Studio 2010旗舰版为自动化测试提供了支持.本文介 ...

  9. 项目发布到Tomcat8中报错 “Resource is out of sync..."

    在eclipse中搜索时,搜索完之后有时候会弹出错误对话框,错误摘录如下:Resource is out of sync with the file system...... 分析:有时候因为时间紧迫 ...

  10. [iOS]C语言技术视频-13-指针变量练习三(结构体指针变量)

    下载地址: 链接: http://pan.baidu.com/s/1bnx2xm3 密码: t4mj