SQL like wildcard character essay

Source: Internet
Author: User

Wildcard description

_ Match with any single character

% matches a string that contains one or more characters

[] matches any single character in a specific range (for example, [a-f]) or a specific set (for example, [abcdef]).

[^] matches any single character other than a specific range (for example, [^a-f]) or a specific set (for example, [^abcdef]).

Example:

? WHERE FirstName like ' _im ' can find all three-letter, end-of-Im names (for example, Jim, Tim).

? WHERE LastName like '%stein ' can find all employees whose last name ends with Stein.

? where LastName like '%stein% ' can find all employees in the surname, including Stein, anywhere in the family name.

? WHERE FirstName like ' [Jt]im ' can find three-letter names ending with IM and starting with J or T (that is, Jim and Tim only)

? WHERE LastName like ' m[^c]% ' can find all surnames starting with M, followed by (second) letter not C.

Querying for data with single quotes

For example, to check data containing ' 123 ' (including single quotes)

Where field like '% ' ' 123 '% ' (123 not double quotes are two single quotes equivalent to ' escaped ')

SQL like wildcard character essay

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.