I am using SQL Server 2008, I urgently need sql query or stored procedure to display top brands in any category or sub-category. For example if I pass IdCategory=2, the result set should display top brands in Electronics by performing products count on idCategory=2 as well as its sub categories and sub-sub-categories. If I pass IdCategory=38, the result should display top brands in Phones & Mobile Devices as well as Mobile Phones. I hope I am able to clear my requirement. I am using SQL Server 2008, I urgently need sql