I\'m using LINQ on an IQueryable returned from NHibernate and I need to select the row with the maximum value(s) in a couple of fields.
I\'ve simplified the bit tha
More one example:
Follow:
qryAux = (from q in qryAux where q.OrdSeq == (from pp in Sessao.Query() where pp.FieldPk == q.FieldPk select pp.OrdSeq).Max() select q);
Equals:
select t.* from nametable t where t.OrdSeq = (select max(t2.OrdSeq) from nametable t2 where t2.FieldPk= t.FieldPk)