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 |
|
dnf999
Constraint Violating Yak Guru
253 Posts |
Posted - 2009-10-08 : 06:41:51
|
| Hi Guys,I have a table which looks roughly like this(sorry for the formatting) 0-10% 20-30% 30-40%Loans 1455 43 83Value 324343 893849 93738and I need it to be like this:0-10% 1455 324343 20-30% 43 89384930-40% 83 93738i.e the values in the rows as values in columns and the column names as values..Assistance would be greatly appreciated! |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-10-08 : 07:06:07
|
That's UNPIVOT. N 56°04'39.26"E 12°55'05.63" |
 |
|
|
dnf999
Constraint Violating Yak Guru
253 Posts |
Posted - 2009-10-08 : 07:30:47
|
| would you be able to give me an example on how I can apply it to the above sample? I've looked at forums, but never seem to get my head around how to script it... :( |
 |
|
|
dnf999
Constraint Violating Yak Guru
253 Posts |
Posted - 2009-10-09 : 11:38:38
|
| Can i do this without an ID field??Thanks |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-10-09 : 12:50:31
|
| http://wiki.lessthandot.com/index.php/Column_To_Row_(UNPIVOT) |
 |
|
|
|
|
|