You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How can I implement the RANK() function taking into account two columns for the ranking? The main column does not have unique values. This is the query:
select *, RANK() over (order by score, posteddate desc) as rank from Post
I need to implement pagination without the offset limit pattern and I thought a kind of ranking function would be ok. I have a partial implementation which only works with uniques, using the '>' or '<' operands on the key used for pagination.
Any idea? I cannot find a solution online.
Cheers.
The text was updated successfully, but these errors were encountered:
To do this you would need to drop down to a raw SQL query, using the DbSet.FromSql(string) method. You'd also need to introduce a new model type that includes the Rank property since it is in the SELECT list (we have #1862 tracking the ability to return results into a type that is not part of the model).
Hi,
How can I implement the RANK() function taking into account two columns for the ranking? The main column does not have unique values. This is the query:
select *, RANK() over (order by score, posteddate desc) as rank from Post
I need to implement pagination without the offset limit pattern and I thought a kind of ranking function would be ok. I have a partial implementation which only works with uniques, using the '>' or '<' operands on the key used for pagination.
Any idea? I cannot find a solution online.
Cheers.
The text was updated successfully, but these errors were encountered: