I have following MySQL db table filled with data:
|id|parentId|position
|20|NULL |1
|21|NULL |2
|22|NULL |3
|23|21 |1
|24|21 |2
Is it possible to sort it to get final result as:
|id|parentId|position
|20|NULL |1
|21|NULL |2
|23|21 |1
|24|21 |2
|22|NULL |3
As you may notice, position inside parent starts from 1.
So I want it sorted by three columns: id, parentId and position. Any ideas?
