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 |
|
sqllover
Constraint Violating Yak Guru
338 Posts |
Posted - 2011-04-06 : 06:16:15
|
| Table 1 :Key P_respTable 2 :Key Pro_respSo user provides the key. If the 6th position of key is 'B' then select Table1.P_resp value else select Table2.Pro_resp. How to write this using select case ? please help me in this |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-04-06 : 06:18:02
|
[code]if substring (@key, 6, 1) = 'B' select Table1.P_resp value from Table1else select Table2.Pro_resp from Table2[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
sqllover
Constraint Violating Yak Guru
338 Posts |
Posted - 2011-04-06 : 06:25:20
|
| can u please provide full query. that would help a lot |
 |
|
|
sqllover
Constraint Violating Yak Guru
338 Posts |
Posted - 2011-04-06 : 06:37:15
|
| Hi friend thaks for the help. I just confused my self. Now I realised |
 |
|
|
|
|
|