You can make use of, or base yourself on, the built-in report 'Users: AD users and their managers' for this. It basically left joins the database table tblADObjects to tblADusers on ADObjectID and ManagerADObjectId.
For your convenience, you can find the report below
Select Top 1000000 tblADusers.Username,
tblADusers.Userdomain,
tblADusers.Firstname,
tblADusers.Lastname,
tblADusers.Name,
tblADusers.Displayname,
tblADusers.email As Email,
tblADObjects.sAMAccountName As ManagerName,
tblADObjects.domain As ManagerDomain
From tblADusers
Left Join tblADObjects On
tblADObjects.ADObjectID = tblADusers.ManagerADObjectId
Order By tblADusers.Userdomain,
tblADusers.Username