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 2000 Forums
 Transact-SQL (2000)
 CrossTab

Author  Topic 

rajeshnrh74
Starting Member

5 Posts

Posted - 2007-06-20 : 07:00:32
Gurus,

I've SQL Server 2000 Table like this

Cl: Business: Source: Analyst: Times:
GE -- Analytics -- Peer -- Chayan -- Once
AA -- Collections -- Third -- Remya -- Twice


I want Output like this

Cl: Business: Source: Chayan: Remya:
GE -- Analytics -- Peer -- Once -- Nil
AA -- Collections -- Third -- Nil -- Twice

I seek your precious help

Rajesh N.

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-06-20 : 07:05:24
search from CROSS TAB or PIVOT in this site. There are lots of thread on this issue


KH

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-06-20 : 08:19:15

http://weblogs.sqlteam.com/jeffs/archive/2005/05.aspx

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Koji Matsumura
Posting Yak Master

141 Posts

Posted - 2007-06-20 : 21:22:19
If number of Analysts is known:

SELECT CI, Business, Source,
Chayan = CASE WHEN Analyst = 'Chayan' THEN Times END,
Remya = CASE WHEN Analyst = 'Remya' THEN Times END
FROM YourTable
Go to Top of Page
   

- Advertisement -