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 |
danasegarane76
Posting Yak Master
242 Posts |
Posted - 2014-03-14 : 02:00:02
|
Hi Team, I am using like operator to get some resultsAnd the data looks likeCountryCodes503:51,880:51,936:51,952And when I use likeSelect * from table where CountryCodes like '%503:5%' This gets the above set results. But I want to match the exact text . This means that need to get the result only if503:5,880:51,936:51,952Any way to this |
|
nagino
Yak Posting Veteran
75 Posts |
Posted - 2014-03-14 : 02:18:01
|
Like Following ?Select * from table where CountryCodes like '%503:5,%' or CountryCodes like '%503:5'-------------------------------------From JapanSorry, my English ability is limited. |
|
|
danasegarane76
Posting Yak Master
242 Posts |
Posted - 2014-03-14 : 02:22:13
|
Yes, I tried this and this looks like working with one issue. I can see the search functionality using a common function where %% append is added globally.I would like to something likeSelect * from table where CountryCodes like '%503:5[\,]%' where the last , may or may not exist there. Any way to handle this |
|
|
nagino
Yak Posting Veteran
75 Posts |
Posted - 2014-03-14 : 02:41:20
|
Select * from table where CountryCodes + ',' like '%503:5,%'-------------------------------------From JapanSorry, my English ability is limited. |
|
|
|
|
|
|
|