linq 中怎么表达 SQL中的 not in-CSDN论坛
1个回答
2015-09-06
展开全部
StuDBDataContext db = new StuDBDataContext();
var query = stuInfo.Where(x => !StuMarks.Select(y => y.stuNo).Contains(x.stuNo));
//select * from stuInfo where stuNo not in(select stuNo from StuMarks)
foreach (var c in result)
{
Console.WriteLine(c.StuNo);
}
var query = stuInfo.Where(x => !StuMarks.Select(y => y.stuNo).Contains(x.stuNo));
//select * from stuInfo where stuNo not in(select stuNo from StuMarks)
foreach (var c in result)
{
Console.WriteLine(c.StuNo);
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询