In TSQL, how to check a string include “a” followed by “b”, and “b” not followed by “c”? For example, these strings is what I want:
ab
cab
acb
This is not what I want:
abc
Note that you can insert any number of characters between the characters in the example(but not break my rule described above).
Use the SQL wildcard character
%to define any characters (one or multiple) within a string, then combine it with theLIKEoperator: