EFCore中 join on的不同
程序员文章站
2022-04-08 19:21:48
当 多条件 left join on 时 LEFT OUTER JOIN on new { u.UserId, ue.ExamId } equals new { sac.UserId, sac.ExamId } into sac2 from sac in sac2.DefaultIfEmpty() ......
当 多条件 left join on 时
left outer join
on new { u.userid, ue.examid } equals new { sac.userid, sac.examid }
into sac2
from sac in sac2.defaultifempty()
生成sql 为
on ([filter1].[userid1] = [groupby1].[k1]) and (([filter1].[examid2] = [groupby1].[k2]) or (([filter1].[examid2] is null) and ([groupby1].[k2] is null)))
单条件 on 时
sql on 没有空值判断
left outer join [dbo].[sysquestion] as [extent3] on [groupby1].[k1] = [extent3].[queid]
上一篇: 洛谷P2470 [SCOI2007]压缩(区间dp)
下一篇: 火警