I have created an odata service for testing purposes in SEGW. My Query string looks like:
/.../ProductsSet?$select=Id,Title,Description,Price,Rating&$filter=startswith(Title,'S')&$inlinecount=allpages&$skip=10&$top=10&$orderby=Rating desc&$format=json
However, I get unexpected weird result sets. Can somebody explain me how the order of e.g filter, skip, top, orderby, select is executed in OdataV2 and v4, in the backend, to reproduce the results? I mean how do the query options influence each other?
ok I think I can reproduce the database logic how it retrieves the data (and in what order of the query parameters).. I got 18 entries after filtering for "S" first (actually its 17, the second entry with small "s" doesnt count"). From there, it got ordered by Rating desc. Then skip the first 10 (skip 10) and get the other 10 (offset 10) entries (which leaves only 7 entries).
This also corresponds to the order of my select statement (maybe its incidentally only). I'm not sure anymore what DB S4/HANA uses, but e.g in SQL Server I remember that its the query-optimizer that makes sure that filtering comes first (to get a smaller subset) etc...
This is the result in json: