Wildcard in the database query

xiaoxiao2021-03-06  43

1.access:

Example, "Like 'P [A-F] ###'", indicates any letters and 3 numbers that are tight between A to F back at the beginning of the uppercase letter P.

The following table shows how to pass

Like to test different modes of expression.

Match type mode match (Return true) Match (return false) Multiple characters AAA, ABA, ABBBAABC * AB * ABC, AABB, XABAZB, BAC Special Character A [*] AA * AAAA Multiple Character AB * ABCDEFG, ABCCAB, AAB Single Character A? A Single Digital A # AA0A, A1A, A2AAA, A10A Character Range [AZ] F, P, J2, & Range Outside [! AZ] 9, &,% B, A Nonitable value [ ! 0-9] A, A, &, ~ 0, 1, 9 composite value a [! Bm] # AN9, AZ0, A99ABC, AJ0

2.SQL:

Example, "

Like 'mac%', search for records starting with a Mac.

Wildcard meanings% (percent) There is a zero or more character _ (underscore) in this location. There is a character.

If you need a wildcard in the value you need to search, such as "10%", you can use the LIKE statement by specifying the escape character. Example: "Like '% 10 # %%' Escape '#'" means a search contains "10% "record of.

转载请注明原文地址:https://www.9cbs.com/read-57316.html

New Post(0)