我必须列出所有要分配给“员工”的“班次”数据,但是如果班次数据已经存在于员工的数据中,则不能包括在内。请看下面的图片示例。
这个查询可以解决这个问题。我在这里找到了它:
Scott's Blog
Scott's Blog
select * from shift where not exists
(select 1 from employeeshift where shift.shiftid = employeeshift.shiftid
and employeeshift.empid = 57);
让我们来看一下结果:
现在我的问题是,我该如何在linQ中实现这个呢?我正在使用Entity Framework。
希望有人能帮忙。非常感谢!!!