title: How to find nth child of a record in sql query
body: <p>I have a table which stores categories and sub categories (self join)</p>
  
  <pre><code>The table structure is like this:
  -CategoryId
  -CategoryName
  -ParentCategoryId
  </code></pre>
  
  <p>How to find nth child/childs of a category in sql query</p>