I have a table with column mapping which store record: "IV=>0J,IV=>0Q,IV=>2,V=>0H,V=>0K,VI=>0R,VI=>1,"
What is the sql to check whether or not a substring is in column mapping. so, I would like this:
- if I have
"IV=>0J"would return true, becauseIV=>0Jis exact in string "mapping" - if I have
"IV=>01"would return false. And so on...
I try this:
SELECT * FROM table WHERE charindex('IV=>0J',mapping)
But when I have "IV=>0", it returns TRUE. But, it should return FALSE.
Thank You..
WHERE mapping LIKE '%IV=>OJ%?IV=>0,but it's still bad relational design. LIKE or CHARINDEX can't take advantage of any indexes too, which means that your query will result in a full table scan