AspNetCoreOData icon indicating copy to clipboard operation
AspNetCoreOData copied to clipboard

Enhancement: Need Support for ROW_NUMBER() with PARTITION BY and ORDER BY

Open f16hari opened this issue 2 years ago • 0 comments

Need support to have ROW_NUMBER() column with PARTITION BY and ORDER BY clause to be used along with $filter to retrieve specific entities based on the rank no. e.g. for the below schema you might be interested to retrieve the details of products having max price in each category. Product { Id: Number, Name: String, Category: String, Price: Number }

The URL can be something like: https://<host>/odata...?$compute=rowNumber($select=Category;$orderby=Price desc) as row&$select=Id,Name,Category,Price&$filter=row eq 1

f16hari avatar Nov 12 '23 13:11 f16hari