日期:2014-05-20 浏览次数:20750 次
select a.* from Test a
inner join TripLine b on a.RefID=b.ID
inner join
(
select distinct(a.ID) from TripLine a
left join TripLinePlan b on a.ID=b.TripLineID
where b.OnlineFlag=1 and c.CreateDate <='2013-08-08'
) c on b.ID=c.ID
where b.OnlineFlag = 1
var query=from a in Test
join b in TripLine on a.RefID equals b.ID
join c in TripLinePlan on b.ID equals c.TripLineID into lg
from c in lg.DefaultIfEmpty()
where c.OnlineFlag==1 && c.CreateDate <=Convert.ToDateTime("2013-08-08")
select a;