0
你如何将两个子查询与WithSubQuery的查询结合起来?我想类似下面(准确的语法无所谓):通过比较两个子查询的NHibernate查询
query.WithSubquery.WhereValue(QueryOver.Of<Child>()
.Where(m => m.Parent.Id == paretAlias.Id)
.Select(Projections.Max("SomeProp")))
.Lt(QueryOver.Of<Child>(() => childAlias)
.Where(m => childAlias.Id == parentAlias.Id)
.Select(Projections.Max("SomeOtherProp")));
我看不到,让我来比较两种方法WithSubquery的任何方法。它有
其中:需要拉姆达
WhereProperty:需要一个属性与子查询
WhereValue比较:取一个值与子查询
WhereExists比较:需要查询。
基本上我想有一个方法需要子查询与和另一个子查询
比较在SQL中的示例输出的查询是:
select * from Parent inner join child on parent.id = child.parentid where
(select max(SomeProp) from child where child.parentid = parent.id) > (select max(SomeOtherProp) from child where child.parentid = parent.id)
你能提供一个你希望生成的SQL看起来像什么样子的例子吗? –