The meaning of four kinds of matching characters
% represents 0 or more arbitrary characters
Represents an arbitrary character
[] Any single character within the specified range
[^] Any single character not in the specified range
Strings with matching characters must be enclosed in quotation marks, such as the following example:
Like ' br% ' returns any string that starts with "BR".
Like ' br% ' returns any character that starts with "Br".
Like '%een ' returns any string that ends with "een".
Like '%en% ' returns any string containing "en".
Like ' en ' returns a string of three characters ending with "en".
Like ' [ck]% ' returns any string that starts with "C" or "K".
Like ' [S-v]lng ' returns a string of four characters, ending with ' ing ', which starts from S to V
Like ' m[^c]% ' returns any string that starts with "M" and the second character is not "C". Attention:
Using the LIKE operator usually causes SQL Server to not use the index associated with the given table. It tells SQL Server to compare the specified string and find any content that matches the provided matching character. Because of this, it is not recommended to use this type of search or comparison on large tables, or at least to remind users that it is important for the system to find the waiting time required to meet the criteria for searching data rows.