title: Sort order of group as Parent & Child in Alphabetical Order
body: <p>I have following values in table</p>
  
  <pre><code>id       | name      | parent_id |
  
  1        | test      | 0         |
  2        | test1     | 3         |
  3        | test2     | 1         |
  4        | test3     | 3         |
  5        | test3     | 4         |
  </code></pre>
  
  <p>so I want output like </p>
  
  <pre><code>id       | name      | parent_id |
  
  1        | test      | 0         |
  3        | test2     | 1         |
  2        | test1     | 3         |
  4        | test3     | 3         |
  5        | test3     | 4         |
  </code></pre>
  
  <p>means sort order so that table has a parent, it is listed below its parent, in alpha order .</p>
  
  <p>I have tried following query but not working:</p>
  
  <pre><code>SELECT * FROM `table` ORDER BY coalesce(parent_id, id), name
  </code></pre>
  
  <p>Pl. help. Thanks in advance</p>