What do you mean by it does not work? Have you put some effort by yourself? 
-- Prepare Sample datadeclare @t table( uid int, username varchar(50), reporingmanagerid int)insert @tselect 1, 'Ramesh', 2 union allselect 2, 'Raju', 4 union allselect 3, 'Kalyani', 1 union allselect 4, 'madhu', null -- Actual QuerySELECT a.uid, a.username, b.username AS managernameFROM @t a left OUTER JOIN @t b ON b.uid = a.reporingmanageridwhere a.username = 'Ramesh'
Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED"