Forum Moderators: open
id ¦ name ¦ id_parent ¦ id_child
1 ¦ Team Lead ¦ 10 ¦ 0
2 ¦ Senio Prg ¦ 20 ¦ 10
3 ¦ Call centre ¦ 30 ¦ 20
4 ¦ Programmer ¦ 40 ¦ 10
etc...
I would like to make a select that will order the data same way as left join. That means: Below Team Lead should be Senio Prg and Programmer.
id_child rows will be always below id_parent
Can you help me with this please? I know how to solve it with 2 Select statements but I don't think it's the most comfortable way.
Thanks in advance
It would also help if you showed what order the rows should be output in by the query you are requesting.