I need some help with a query. I have a table with inventory that I
need to allow customer searches on. Based on their search criteria, a
preference level is calculated; the higher the preference level, the
higher on the order on the search results.
The hard part is when the results are supposed to be limited to a
maximum number of stores and items. Let's say that they only want to
see 3 stores and a max of 5 items per store. What needs to be
returned is the 3 stores with the best Preference and the 5 best items
at each store.
Create Table Inventory( StoreId int, ItemId int, Preference int )
need to allow customer searches on. Based on their search criteria, a
preference level is calculated; the higher the preference level, the
higher on the order on the search results.
The hard part is when the results are supposed to be limited to a
maximum number of stores and items. Let's say that they only want to
see 3 stores and a max of 5 items per store. What needs to be
returned is the 3 stores with the best Preference and the 5 best items
at each store.
Create Table Inventory( StoreId int, ItemId int, Preference int )
Comment