Page 1 of 1

Want to display all Products with groupings

Posted: Thu Aug 05, 2010 11:09 am
by Mike718NY
Are there any sql queries out there to display
all the products in the database, grouped by Category, Vendor, etc.?

SELECT [Name] ,[Price] ,[ManufacturerId] ,[Sku] ,[ModelNumber] ,VisibilityId]
FROM ac_Products

but would need joins to other tables.
Has anyone have already written these queries?

Re: Want to display all Products with groupings

Posted: Fri Aug 06, 2010 5:24 am
by mazhar
Simple query could be something like this. I am not sure about grouping you can extend it to meet your needs

Code: Select all

SELECT P.Name ,P.Price ,P.ManufacturerId,CN.CategoryId ,P.Sku ,P.ModelNumber ,P.VisibilityId
FROM ac_Products AS P JOIN ac_CatalogNodes AS CN ON P.ProductId = CN.CatalogNodeId
WHERE CN.CatalogNodeTypeId=1