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.
Author |
Topic |
bi89405
Starting Member
35 Posts |
Posted - 2011-11-29 : 16:59:13
|
I have the following dataset.AcctID input_name dataA1225 WOFFAR OffA1225 CLOSEMT OffA1225 CURRSTAT OffA1225 FORMSTAT OffA1225 FORMCLLTR YesA1225 WOFFUB OffI would like to get the following output.AcctID WOFFAR CLOSEMT CURRSTAT FORMSTAT FORMCLLTR WOFFUBA1225 Off Off Off Off Yes OffAny way to do that using SQL 2005?TIA,Zack H. |
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2011-11-29 : 17:38:11
|
You'll want to use the PIVOT operator with the MAX aggregate function, examples can be found here: http://msdn.microsoft.com/en-us/library/ms177410.aspx |
 |
|
sql-programmers
Posting Yak Master
190 Posts |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-11-30 : 01:30:47
|
i hope your header column values will be static else you've to use dynamic sql------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|