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 |
|
SQLWonderer
Starting Member
1 Post |
Posted - 2011-11-08 : 02:40:26
|
| Hi can anyone tell me whats wrong with this: 'XYZ'= Case When contactnote like '%ABC%' then 'No' Else 'Yes' endcause I am getting both yes and no responsible hence the duplicationmany thanks,S |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-11-08 : 03:05:43
|
| nope you wont get both. I think it may be that you would have records satisfying both in table. If you can show some sample data then we would get more idea------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
jassi.singh
Posting Yak Master
122 Posts |
Posted - 2011-11-08 : 03:36:48
|
| SELECT CaseWhen 'abc' like '%ABC%' then 'No'Else 'Yes'ENDAbove query give you No.SELECT CaseWhen 'tttt' like '%ABC%' then 'No'Else 'Yes'endAbove query give you Yes.Please mark answer as accepted if it helped you.Thanks,Jassi Singh |
 |
|
|
|
|
|