I have a table which has these columns:
id, user_id, parent_id, sport_id
I want to create children using user_id column instead of id.
for example:
id user_id parent_id sport_id
1 20 null 2
2 25 20 2 # user#20 is user#25 parent.
3 28 25 2 # user#25 is user#28 parent.
4 29 20 2 # user#20 is user#29 parent.
please tell me what should I do?