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 |
oasis1
Starting Member
35 Posts |
Posted - 2010-09-08 : 10:53:19
|
I have to merge two rows together into one.I have a table that looks like thisDept Year PercentageMOA 2009 40MOA 2010 35HON 2009 64WAI 2010 27I need the final output to look like thisDept 2009 2010 MOA 40 35HON 64 N/AWAI N/A 27 Mahalo for your help. |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2010-09-08 : 22:16:54
|
[code]select *from yourtable pivot ( max(Percentage) for Year in ([2009], [2010]) )p[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
|
|