开发者

NHibernate queryover join tables

开发者 https://www.devze.com 2023-03-05 03:07 出处:网络
I have a question.. How to join two tables tah are related but not have direct relation constraint in nhibernate queryover?

I have a question.. How to join two tables tah are related but not have direct relation constraint in nhibernate queryover?

Table1 { ID Title }

Table2 { ID VALUE ALIAS } Table1 and Table2 has not fk relationship constraint. Need to Do something like this:

Select Table1.Title, 
Table2.Alais 
from Table1
   inner join (Select Value from table2 where ALIAS = 'someAlias')
where Table1.ID = T开发者_Go百科able2.Value

Please help thanks.


Have you tried just using the where clause?

Select Table1.Title, Table2.Alais 
from Table1, Table2
where Table1.ID = Table2.Value
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号