1

我有一个问题..如何在 nhibernate 查询中加入两个相关但没有直接关系约束的表?

表 1 { ID 标题 }

Table2 { ID VALUE ALIAS } Table1 和 Table2 没有 fk 关系约束。需要做这样的事情:

Select Table1.Title, 
Table2.Alais 
from Table1
   inner join (Select Value from table2 where ALIAS = 'someAlias')
where Table1.ID = Table2.Value

请帮忙谢谢。

4

1 回答 1

0

您是否尝试过仅使用 where 子句?

Select Table1.Title, Table2.Alais 
from Table1, Table2
where Table1.ID = Table2.Value
于 2011-05-12T08:17:18.393 回答