title: sort a table while keeping the hierarchy of rows
body: <p>I have a table which represents the hierarchy of departments:</p>
  
  <pre><code>+-----------+--------------+--------------+--------------+-----------+-------+
  | Top Dept. | 2-tier Dept. | 3-tire Dept. | 4-tier Dept. |    name   |  tier |
  +-----------+--------------+--------------+--------------+-----------+-------+
  |        00 |              |              |              |    abc    |   0   |
  |           | 00-01        |              |              |    bcd    |   1   |
  |           |              | 00-01-01     |              |    cde    |   2   |
  |           |              | 00-01-02     |              |    abc    |   2   |
  |           | 00-02        |              |              |    aef    |   1   |
  |           |              | 00-02-01     |              |    qwe    |   2   |
  |           |              | 00-02-03     |              |    abc    |   2   |
  |           |              |              | 00-02-03-01  |    abc    |   3   |
  +-----------+--------------+--------------+--------------+-----------+-------+
  </code></pre>
  
  <p>now I want to sort the rows which are in the same tier by their names while keeping the hierarchy overall, That's what I expect:</p>
  
  <pre><code>+-----------+--------------+--------------+--------------+-----------+-------+
  | Top Dept. | 2-tier Dept. | 3-tire Dept. | 4-tier Dept. |    name   |  tier |
  +-----------+--------------+--------------+--------------+-----------+-------+
  |        00 |              |              |              |    abc    |   0   |
  |           | 00-02        |              |              |    aef    |   1   |
  |           |              | 00-02-03     |              |    abc    |   2   |
  |           |              | 00-02-01     |              |    qwe    |   2   |
  |           | 00-01        |              |              |    def    |   1   |
  |           |              | 00-01-02     |              |    abc    |   2   |
  |           |              | 00-01-01     |              |    cde    |   2   |
  |           |              |              | 00-02-03-01  |    abc    |   3   |
  +-----------+--------------+--------------+--------------+-----------+-------+
  </code></pre>
  
  <p>the missing data means null, I'm using Oracle DB, can anyone help me?<br>
  EDIT: Actually, it's a simple version of <a href="http://sqlfiddle.com/#!4/f1371/10/0" rel="nofollow">this sql</a>, I've tried to add a new column which concats the values of the first four columns and then order by it and by name, but it did't work.</p>