Use column output, to get new column
Database
2
Posts
2
Posters
0
Views
1
Watching
-
I am using Sql server 2008. I have 3 columns say, UserID,ManagerID,deptCode. I need the output as UserID,ManagerID,deptCode,ManagersDeptCode So, the column "ManagerID" need to be used to generate the output of "ManagersDeptCode". Please help.
Join back to your user table using the managerid ot userid to get the managers details
Select U.*, M.*
From UserTable U
inner join UserTable M on M.userID = U.ManagerIDNever underestimate the power of human stupidity RAH