title: SQL sorting such that rows are sorted only where another column value is equal
body: <p>I have a SQL query problem. So here is a table which is a result of a large query.</p>
  
  <p><code>+---------+-------------+------------+
  | page_id | TotalDegree | matchCount |
  +---------+-------------+------------+
  |     116 |      7.0000 |          4 |
  |     142 |      3.0000 |          4 |
  |     109 |      4.0000 |          2 |
  |     119 |      4.0000 |          2 |
  |     108 |      2.0000 |          2 |
  |     132 |      4.0000 |          1 |
  |     133 |      9.0000 |          1 |
  |     146 |      9.0000 |          1 |
  |     114 |      4.0000 |          1 |
  |     125 |      9.0000 |          1 |
  |     113 |      1.0000 |          1 |
  |     127 |      9.0000 |          1 |
  |     120 |      4.0000 |          1 |
  |     129 |      9.0000 |          1 |
  |     121 |      9.0000 |          1 |
  +---------+-------------+------------+
  15 rows in set (0.00 sec)
  </code>  </p>
  
  <p>Now I want to sort a table on the basis of 'TotalDegree' in ascending order such that sorting should be done internally where the 'matchCount' column value is same.
  Example: The first two rows has 'matchCount' value 4 so sorting should be done in between these two rows on the basis of 'TotalDegree' in ascending order.
  Similarly, all the rows with 'matchCount' equals to 1 should be sorted amongst themselves.
  So the sorted table should look like as below.</p>
  
  <p><code>+---------+-------------+------------+
  | page_id | TotalDegree | matchCount |
  +---------+-------------+------------+
  |     142 |      3.0000 |          4 |
  |     116 |      7.0000 |          4 |
  |     108 |      2.0000 |          2 |
  |     109 |      4.0000 |          2 |
  |     119 |      4.0000 |          2 |
  |     113 |      1.0000 |          1 |
  |     132 |      4.0000 |          1 |
  |     114 |      4.0000 |          1 |
  |     120 |      4.0000 |          1 |
  |     133 |      9.0000 |          1 |
  |     146 |      9.0000 |          1 |
  |     125 |      9.0000 |          1 |
  |     127 |      9.0000 |          1 |
  |     129 |      9.0000 |          1 |
  |     121 |      9.0000 |          1 |
  +---------+-------------+------------+
  </code><br>
  How can such a query can be designed ? Thanks in advance.</p>