Recursive Query using CTE in SQL Server 2005
问题 OK, here's what I'm trying to do. I'm using a CTE query in MSSQL2005. The objective of the query is to recurse through Parent child relationships of product categories and return the number of products under each category (this includes any products contained in children categories) My current version only returns the product count for the category being displayed. It's not accounting for products that may be contained within any of its children. The database dump to reproduce the problem,