现在有一句sql语句: select * from upt_organizationstruct where uos_id not in (select distinct uos_parentlevel from upt_organizationstruct where uos_parentlevel is not null)
这样子: var q = ( from o in upt_organizationstruct select o ).Except( from p in uos_parentlevel where p.uos_parentlevel <> null select p ); foreach (var result in q) { ...... }