日期:2014-05-17 浏览次数:20999 次
SELECT * FROM 会议表
LEFT JOIN 会议用户多对多表
ON 会议表.ID == 会议用户多对多表.会议ID
LEFT JOIN 用户表
ON 会议用户多对多表.用户ID = 用户表.ID
WHERE 用户表.ID = 1
var query=from a in 会议表
join b in 会议用户多对多表 on a.ID==b.会议ID into join1
from x in join1.DefaultIfEmpty()
join c in 用户表.Where(p=>p.ID==1) on b.用户ID==c.ID into join2
from y in join2.DefaultIfEmpty()
select new
{
需要取出的字段组成的匿名类
}
var query=from m in 会议表
join mu in 会议用户多对多表 on m.ID equals mu.会议ID into g1
from mu in g1.DefaultIfEmpty()
join u in 用户表 on mu.用户ID equals u.ID into g2
from u in g2.DefaultIfEmpty()
select m;