[SalesForce] How to fetch manager name and their profile along with username and userid

Requirement:-I need to fetch userName,UserID along with manager names and manager profileName in single query .

i have used below query but i am not getting manager profileName

select userName,UserID,manager.name,manager.Id from user

How should i fetch manager-Profile name here
Please suggest.Urgent

Best Answer

Does this work for you?

select userName,id,manager.name,manager.Id, manager.profile.name from user