I want to select latest post for each user. how can I implement following query using LLBL Gen predicates
select *
from tblPosts as n1
where DateCreated in
(select max(DateCreated)
from tblPosts as n2
where n1.UserId = n2.UserId)
order by DateCreated
i have tried following but only returning last entry not latest entry for each user. how can i alias tblPosts table
filter.PredicateExpression.Add(new FieldCompareSetPredicate(TblPostsFields.DateCreated, null, TblPostsFields.DateCreated.SetAggregateFunction(AggregateFunction.Max), null, SetOperator.In,TblPostsFields.UserId==TblPostsFields.UserId));
thanks in advance