| Author |
Topic |
|
BankOfficerHere
Posting Yak Master
124 Posts |
Posted - 2008-10-03 : 09:01:25
|
| How can I change my table data from horizontal to vertical form?Thanks |
|
|
elancaster
A very urgent SQL Yakette
1208 Posts |
Posted - 2008-10-03 : 09:05:53
|
| are you using 2005? if so take a look at UNPIVOT in books online. if that's not what you're looking for perhaps you should supply us some sample data / examples of what you're trying to doEm |
 |
|
|
YellowBug
Aged Yak Warrior
616 Posts |
Posted - 2008-10-03 : 09:06:22
|
| Look up the PIVOT syntax in BOL |
 |
|
|
BankOfficerHere
Posting Yak Master
124 Posts |
Posted - 2008-10-03 : 09:06:37
|
| I'm using 2000 |
 |
|
|
BankOfficerHere
Posting Yak Master
124 Posts |
Posted - 2008-10-03 : 09:08:46
|
| Here's my data:Name Question1 Question2 Question3 Question4Mike Yes No Yes NoMichelle No Yes No YesMike Yes No Yes NoMichelle Yes No Yes NoChange to this Name Mike Michelle Mike MichelleQuestion1 Yes No Yes YesQuestion2 No Yes No NoQuestion3 Yes No Yes YesQuestion4 No Yes No No |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-10-03 : 09:38:25
|
| Do you have an ID column or unique valued column in your db? |
 |
|
|
BankOfficerHere
Posting Yak Master
124 Posts |
Posted - 2008-10-03 : 09:41:58
|
| Here it is againID Name Question1 Question2 Question3 Question41 Mike Yes No Yes No2 Michelle No Yes No Yes3 Mike Yes No Yes No4 Michelle Yes No Yes No Change to this ID 1 2 3 4 Name Mike Michelle Mike Michelle Question1 Yes No Yes Yes Question2 No Yes No No Question3 Yes No Yes Yes Question4 No Yes No No |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-10-03 : 10:06:54
|
| some methods herehttp://www.mssqltips.com/tip.asp?tip=937 |
 |
|
|
BankOfficerHere
Posting Yak Master
124 Posts |
Posted - 2008-10-03 : 10:09:00
|
| what do you suggest on my problem? |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-10-03 : 10:12:20
|
quote: Originally posted by BankOfficerHere what do you suggest on my problem?
go through various methods in posted link and see what method fits your requirement best. |
 |
|
|
BankOfficerHere
Posting Yak Master
124 Posts |
Posted - 2008-10-03 : 10:14:51
|
| can you give me the statement to my problem? thanks |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-10-03 : 10:17:56
|
quote: Originally posted by BankOfficerHere can you give me the statement to my problem? thanks
did you even had a look at any one method in posted link? Dont expect somebody to provide you a full solution. Just go through the link and at least make a try to find solution yourselves. If you get stuck up somewhere then we will help you. |
 |
|
|
BankOfficerHere
Posting Yak Master
124 Posts |
Posted - 2008-10-03 : 10:26:46
|
| I'm just starting and already stuck up |
 |
|
|
|