[Solved] How do display top 5 products from specific category [closed]

First, let’s define what we need. We need a table (view) with these fields: ProductId, ProductName, ProductViewCount, and RootCategoryId. Imagine, the Category table has RootCategoryId field already. Then we can use this query to receive the result: SELECT P.Id AS ‘ProductId’, P.Name AS ‘ProductName’, PVC.ProductViewCount, C.RootCategoryId FROM Category C INNER JOIN ProductCategory PC ON PC.CategoryId … Read more