Linq如何写子查询的语句

Linq怎么写子查询的语句?SQL中大概这样的SQL codeselect * from 表where id not in( select id from 表 wh

Linq怎么写子查询的语句?
SQL中大概这样的

SQL code
select * from 表where id not in( select id from 表 where xxxx)



转换成Linq该怎么写

[解决办法]

C# code
var query = from p in a where !(from p1 in a select p1.id).Contains(p.id) select p
[解决办法]
探讨
SQL中大概这样的


SQL code
select * from 表
where id not in( select id from 表 where xxxx)



转换成Linq该怎么写