I have set of results like this
ID >> Parent
1 >> 0
2 >> 0
3 >> 0
4 >> 1
5 >> 1
6 >> 2
7 >> 1
8 >> 0
9 >> 3
10 >> 0
I want to sort the record in a way where I display the records by having parent and underneath it all of it children. So the results will look like this
1 >> 0
4 >> 1
5 >> 1
7 >> 1
2 >> 0
6 >> 2
3 >> 0
9 >> 3
8 >> 0
10 >> 0
How can sort the records in this order using MySQL?
Thanks