DEV Community

Sherbin W
Sherbin W

Posted on

2 1

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.

Jetbrains image

Build Secure, Ship Fast

Discover best practices to secure CI/CD without slowing down your pipeline.

Read more

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay