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 |
|
DeepakD
Starting Member
5 Posts |
Posted - 2011-10-28 : 02:22:44
|
| Hi ,Can anybody help me to find a solution for following problem:Input table Col1 col2 col3 col4101 a 400 1102 b 500 1103 c 600 1104 d 700 2105 e 800 2I will pass col4 values like 1 or 1,2The Output table should be like as followsIf I pass col4=1 thenCol1 col2 Col_4_1 101 a 400 102 b 500 103 c 600 If i Pass col4 in (1,2) thenCol1 col2 Col_4_1 Col_4_2 101 a 400 Null102 b 500 Null 103 c 600 Null104 d Null 700105 e Null 800I am thankful to you if anybody give me a suggestion. |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-10-28 : 04:55:01
|
| why do you want to put them to different columns?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
DeepakD
Starting Member
5 Posts |
Posted - 2011-10-28 : 05:17:34
|
| Hi Thank you for your reply,As per the UI team needs I have to put them in different columns. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
DeepakD
Starting Member
5 Posts |
Posted - 2011-10-28 : 08:16:19
|
| Thank You khtan!! |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
|
|
|