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 |
umut
Starting Member
4 Posts |
Posted - 2008-12-02 : 09:38:35
|
Hello everyone, i would like to know how i can use same expression as i use in LIKE clause "%%" in WHEN ?I tried below example but the %% expession does not make sense as how it does in LIKE.CASE FIELD_NAME WHEN '%value%' THEN 10 ELSE 0 END AS SCOREI have to catch similar words as well using CASE WHEN.Any help will be much appreciated.Thanks in advance |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-12-02 : 09:47:44
|
No, you have to specify each comparison.CASEWHEN FIELD_NAME LIKE '%value%' THEN 10WHEN FIELD_NAME > 50 THEN 20ELSE 0END AS SCORE E 12°55'05.63"N 56°04'39.26" |
|
|
umut
Starting Member
4 Posts |
Posted - 2008-12-02 : 09:53:49
|
thank you very much for your response, that was the syntax i needed. |
|
|
|
|
|