Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 How to get output like this through query

Author  Topic 

ranjeetsingh_6
Posting Yak Master

125 Posts

Posted - 2011-01-07 : 06:41:32
I have a table like below and want output as like mention below

Table:

id name Manager
5 C 6
1 A 6
6 F 2
4 D 5
2 B null



output

Name manager
C F
A F
F B
D C
B null

Ranjeet Kumar Singh

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2011-01-07 : 07:26:25
You can google for "MS Sql Server common table expression CTE example".
The CTE examples most have a solution to your problem.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -