DEV Community

Sherbin W
Sherbin W

Posted on

MySQL

In MySQL, I have 3 manager user id and the 10 reporting id. I need one manager data that means name and with his reporting id's names.. can anybody help me

Top comments (4)

Collapse
 
adeleyeayodeji profile image
Adeleye Ayodeji

PHP should help you out

Collapse
 
sherbin29 profile image
Sherbin W

MySQL r python only I needed

Collapse
 
adeleyeayodeji profile image
Adeleye Ayodeji

What language are you outputting with?

Collapse
 
sherbin29 profile image
Sherbin W

Thank you for your response. I need it in MySQL. let me describe the problem. we have 10 employee data in that 1 is manager 2,3,4,5 is an employee they will report to 1 and 6 is manager 7,8,9,10 is an employee they will report to 6. 1 and 6 don't have reporting id but they will have user id. so if am using a self join I am getting the 2,3,4,5 employee name but 1 is missing. that my problem.