sql语句转换成相应的linq语句

现在有一句sql语句:
select * from upt_organizationstruct where uos_id not in
(select distinct uos_parentlevel from upt_organizationstruct where
uos_parentlevel is not null)

它相应的linq语句怎么写?谢谢

这样子:
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)
{
......
}
温馨提示:内容为网友见解,仅供参考
第1个回答  2010-12-24
select upt.* from upt_organizationstruct upt, upt_organizationstruct upto
where upt.uos_id!=upto.uos_parentlevel and upto.uos_parentlevel is not null
第2个回答  2010-12-25
你好,写成linq,应该是
var maxID = (from row in Employee where row.it ==1 select row.ID).Max();
第3个回答  2010-12-28
你可以下载。linq to sql 还有 sql to linq 的小工具,它会帮你转换的,挺好用的,网上搜一下
相似回答
大家正在搜