1

我是 NHibernate 和 queryover 的新手。我想将 nhibernate 查询写入以下 sql。

SELECT A.*
FROM V_FDS_BANK_MASTR_ADTWORKFL A,
     (SELECT DISTINCT BANK_CD
        FROM V_FDS_BANK_MASTR_ADTWORKFL
        WHERE TRUNC (APPROVEDBY_DATE) BETWEEN TO_DATE ('18/03/2013',
                                                          'DD/MM/YYYY')
                                             AND TO_DATE ('19/03/2013',
                                                          'DD/MM/YYYY')) B
   WHERE A.BANK_CD = B.BANK_CD
ORDER BY A.BANK_CD, APPROVEDBY_DATE

非常感谢

4

1 回答 1

0
var results = Session.QueryOver<A>()
    .WhereRestrictionOn(a => a.ApprovedDate).Between(date1, date2)
    .OrderBy(a => a.BankCD)
        .ThenBy(a => a.ApprovedDate)
    .List()
于 2013-05-10T07:03:57.757 回答