SQL Server: SQL like wildcard special usage: Escape
%: Match zero or multiple arbitrary characters; _: match any single character; []: match a range; [^]: exclude a range
symbol
meaning
like '5 [%] '
Like turn from http://blog.csdn.net/wei0527/article/details/4086131Determines whether the given string matches the specified pattern. A pattern can contain regular characters and wildcard characters. During pattern matching, regular characters must
Wildcard characters
Wildcards in SQL are used in place of one or more characters.
SQL wildcard characters are used with the LIKE operator.
Common wildcard characters in SQL Server
%
Matches an arbitrary length character (length can be 0)
If
Reprint: http://new-restart.iteye.com/blog/1416765SQL like wildcard character fuzzy query techniques and special charactersSQL like wildcard character fuzzy query techniques and special charactersHow to deal with time query by 1,sql likeThere are
Transfer from http://new-restart.iteye.com/blog/1416765SQL like wildcard character fuzzy query techniques and special charactersHow to deal with time query by 1,sql likeThere are savetime (smalldatetime type) fields in the SQL data table with two
1. SQL like method for time query processing the SQL data table has a savetime (smalldatetime type) field with two records in the table with Savetime value: 2005-3-8 12:12:00 and 2005-6-6 14:02:02 I can not find anything with the
Like
Determines whether the specified string matches the specified pattern. The mode can contain regular and wildcard characters. During pattern matching, regular characters must match exactly the characters specified in the string. However, any
Specific methods
When the SQL where condition equals a string of special symbols, it is easy to make an error, cut off, not even execute, or cause the database to be dangerous.Let's simply test the followingCreating test data
The code
Data | condition Liketransact-sql reference like
Determines whether the given string matches the specified pattern. Patterns can contain regular characters and wildcard characters. During pattern matching, regular characters must exactly match the
Like
Determines whether the given string matches the specified pattern. Patterns can contain regular characters and wildcard characters. During pattern matching, regular characters must exactly match the characters specified in the string. However,
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.