NHibernate Query

Posted by Nathan Roe on Stack Overflow See other posts from Stack Overflow or by Nathan Roe
Published on 2010-06-03T11:59:03Z Indexed on 2010/06/03 12:04 UTC
Read the original article Hit count: 353

Filed under:
|
|
|

Is it possible to get NHibernate to generate a query similar to the following with HQL or Criteria API?

select
    *
from (
    select
       row_number() over ( partition by Column1 order by Column2 ) as RowNumber,
       T.*
    from
        MyTable T
)
where
    RowNumber = 1

I can get it to execute the inner select using the formula attribute, but I can't figure out a way to write a HQL or Criteria query that lets me wrap the inner select in the outer one.

© Stack Overflow or respective owner

Related posts about c#

Related posts about nhibernate