原文地址:http://blog.sina.com.cn/s/blog_46e9573c01014fx2.html 1.左连接: var LeftJoin = from emp in ListOfEmployeesjoin dept in ListOfDepartmenton emp.DeptID equals dept.ID into JoinedEmpDeptfrom dept in JoinedEmpDept.DefaultIfEmpty()select new …
1.内连接.两个表的公共部分用Inner join,Inner join是交集的部分. Select * from TableA A inner join TableB B on A.key=B.key 2.左外连接.A表和B表的共有,加上A的独有,简称全A. Select * from TableA A left join TableB B on A.key=B.key 红色部分是两表的公有部分,此时8号记录是A表的独有,右边的部门表并没有满足的就用null补齐. 3.右外连接.A表和B表的共…