title: getting herarical data from Parent-child tables?
body: <p>There are 3 data tables:</p>
  
  <p><strong>productCategory</strong>
  It has data of basic categories. This table has two columns( categoryid, categorydescription). </p>
  
  <pre><code>Sample Data
  101 MENS
  102 WOMENS
  103 CHILDRENS
  104 BABIES
  105 FOOTWEAR
  106 HANDBAGS
  107 JEANS
  108 ACCESSORIES
  </code></pre>
  
  <p><strong>productType</strong>
  This table has data of subcategories. It also has two columns (categoryId, producttypedescription).</p>
  
  <pre><code>Sample Data
  112 OTHER
  113 JUMPERS
  114 WOMENS SHOES
  115 JEANS
  116 MENS
  117 WOMENS
  118 KIDS
  119 ACCESORIES
  </code></pre>
  
  <p><strong>categoryLink</strong>
  This table manage there many to many relationship, it has two columns(category, productTypeId).</p>
  
  <pre><code>sample Data
  101 112
  101 113
  102 112
  102 113
  102 114
  103 112
  103 113
  104 112
  104 113
  104 119
  105 112
  105 113
  105 114
  106 112
  107 116
  107 117
  107 118
  </code></pre>
  
  <p>I need to have this data in hierarchical model to display in menus. I am not getting query to do that.</p>
  
  <p>Required Result Set <strong>(I just have produced this just for one code but need all such result combination)</strong></p>
  
  <pre><code>'Category','Category_description','ParentCategory'
  '101','MENS','null',
  '112','OTHER','101',
  '113','JUMPERS','101';
  </code></pre>
  
  <p>Kindly guide and help me.</p>
  
  <p>Thanks</p>