我想获取公民表中使用LINQ在作业表中记录的记录。有人可以在LINQ中翻译吗?谢谢!
SELECT * FROM JOB_MSTR j where j.citizen_id IN (SELECT c.citizen_id from CITIZEN_MSTR c);
答案 0 :(得分:3)
这可以做到
ctx.JOB_MSTR.Where(x => ctx.CITIZEN_MSTR.Any(y => y.citizen_id == x.citizen_id))
答案 1 :(得分:2)
var result = ( from j in ctx.JOB_MSTR
join c in ctx.CITIZEN_MSTR
on j.citizen_id equals c.citizen_id
select j).ToList();