Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Select TOP 3 Categories.id, Categories.Description, avg(Products.Price) as MeanPrice, count(Products.IsAvailable) as NumberOfAvailableProducts
- FROM Categories
- INNER JOIN ProductCategories on Categories.Id =
- ProductCategories.CategoryId
- INNER JOIN Products on Products.Id = ProductCategories.CategoryId
- WHERE Products.IsAvailable='true'
- GROUP BY Categories.Id, Categories.Description
- ORDER BY MeanPrice DESC
Add Comment
Please, Sign In to add comment