遗忘海岸

江湖程序员 -Feiph(LM战士)

导航

2012年7月5日 #

EF中的Select * From T Where id In(xxx,xxx)子查询

摘要: //使用子查询//SQL: Select * From KB_BOMTable Where PartNo in (Select PartNO From KB_MPS Where MPSId='00001')var q1=DBCtx.KB_BOMTable.Where(ent => DBCtx.KB_MPS.Where(t => t.MPSId == MPSId).Select(t => t.PartNo).Contains(ent.PartNo) ); var list= q1.ToList();//使用数组/... 阅读全文

posted @ 2012-07-05 15:08 遗忘海岸 阅读(10364) 评论(0) 推荐(3) 编辑