title: MYSQL select from child categories
body: <p>Trying to get products a couple of levels down the tree... It's not working.</p>
  
  <p>SELECT <code>Products</code>.*
                  FROM        <code>Products</code></p>
  
  <pre><code>            LEFT JOIN   `Product_Categories` C
                  ON  `Products`.`Category_ID` = C.`ID`
                  OR  `Products`.`Sub_Category_ID` = C.`ID`
                  OR  `Products`.`Sub_Category2_ID` = C.`ID`
  
              LEFT JOIN   `Product_Categories` C2
                  ON      C.`ID` = C2.`Parent_ID`
  
              LEFT JOIN   `Product_Categories` C3
                  ON      C2.`ID` = C3.`Parent_ID`
  
              LEFT JOIN   `Product_Categories` C4
                  ON      C3.`ID` = C4.`Parent_ID`
  
              LEFT JOIN   `Product_Categories` C5
                  ON      C4.`ID` = C5.`Parent_ID`
  
              LEFT JOIN   `Product_Categories` C6
                  ON      C5.`ID` = C6.`Parent_ID`
  
              WHERE       `Products`.`Is_Master_Product` = 'Yes'
                  AND     `Products`.`Is_Published` = 'Yes'
                  AND     (`Products`.`Category_ID` = '29'
                          OR      `Products`.`Sub_Category_ID` = '29'
                      OR      `Products`.`Sub_Category2_ID` = '29')
              GROUP BY    `Products`.`Name`
              ORDER BY    `Products`.`Name` ASC
  </code></pre>