从采样器中选择不包含alpum的alphanum(从sampler中选择sampler.alphanum,samplerassignment,sampler.alphanum = samplerassignment.alphanum and isactive = 1);
我有这个语句,并希望使用NHibernate查询来执行它。我怎么把它写在NHibernate中?
答案 0 :(得分:1)
尝试:
string hql = @"select s1.alphanum from sampler s1 where
s1.alphanum not in
(select s2.alphanum from sampler s2, samplerassignment sa where s2.alphanum = sa.alphanum and sa.isactive = 1)";
var result = session.CreateQuery(hql).List();
其中session
是您的NHibernate的ISession。