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 |
|
anupama96
Starting Member
2 Posts |
Posted - 2011-05-14 : 06:26:07
|
| Hi,I am a beginner to sqlserver.here is my problem.i have a table data as belowId Period1 Period2 Period3 Period4 Period5 5 09.30-10.20 10.20-11.10 11.10-12.00 12:00-12:50 12.50-01.40 i want it to be displayed as09.30-10.2010.20-11.1011.10-12.0012:00-12:5012.50-01.40i have tried using row_number but i didnt get as i required.any suggestions??thanks in advanceAnupamaBommaraju |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-05-14 : 06:41:04
|
[code]select periodfrom yourtable t unpivot ( period for col in ([Period1], [Period2], [Period3], [Period4], [Period5]) ) p[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
anupama96
Starting Member
2 Posts |
Posted - 2011-05-16 : 03:39:03
|
Thanks for the quick reply...It was really helpfulquote: Originally posted by khtan
select periodfrom yourtable t unpivot ( period for col in ([Period1], [Period2], [Period3], [Period4], [Period5]) ) p KH[spoiler]Time is always against us[/spoiler]
AnupamaBommaraju |
 |
|
|
|
|
|