SELECT categoryname, c.categoryid, categorydescription, c.parentid, childlevel, isNull(plist.cntofchildren, 0) 'countofchildren', showanonymous, isNull(cnt, 0) AS countofproducts FROM (select * from tblprodcategories where isNull(fk_storeid, 0) in(0, 112)) c LEFT JOIN (SELECT categoryid, count(*) AS cnt FROM tblcategoryproductbridge WHERE productid in(SELECT productid FROM tblproducts WHERE discontinued = 0) group by categoryid ) cn ON c.categoryid = cn.categoryid LEFT JOIN (SELECT parentid , count(*) cntofchildren FROM (select * from tblprodcategories where isNull(fk_storeid, 0) in(0, 112)) ccount group by parentid) plist ON c.categoryid = plist.parentid WHERE c.CategoryID IN( SELECT CategoryID FROM ut_GroupCategoryPermissions WHERE GroupID IN( SELECT GroupID FROM ut_UserGroupMemberShip WHERE UserID=0 ) UNION SELECT CategoryID FROM tblCategorySecurity WHERE UserID= 0 ) OR (0 = 0 AND showanonymous = 1) order by childlevel asc, isNull(sortorder, 100000), categoryname

 


 
  3 oz Care Travel Pack

   
 
  3 oz Color Care Travel Pack

   
 
  Keratin Care Shampoo 33.8 oz w/pump

   
 
  Keratin Care Shampoo 13.5 oz

   
 
  Keratin Care Conditioner 33.8 oz w/pump

   
 
  Keratin Care Conditioner 13.5 oz

   
 
  Keratin Color Care Shampoo 33.8 oz w/pump

   
 
  Keratin Color Care Shampoo 13.5 oz

   
 
  Keratin Color Care Conditioner 33.8 oz w/pump

   
 
  Keratin Color Care Conditioner 13.5 oz

   
 
  Clarifying Shampoo 33.8 oz w/Pump

   
 
  Clarifying Shampoo 12 oz

   
 
  9 Gram Dry Shampoo Applicator - Blonde

   
 
  6 Gram Dry Shampoo Applicator w/ Refill Container

   
 
  9 Gram Dry Shampoo Applicator - White

   
 
  9 Gram Dry Shampoo Applicator - Brunette