Diversity Collection
Query Wildcards
Wildcards in SQL
There are 4 different possibilities for wildcards in SQL:
Operator | Description | Example | Result |
---|---|---|---|
% | any string consisting of no, one or many characters | Pinus % | will find anything like Pinus, Pinus sylvestris, Pinus strobus etc. |
* | same effect as % (see above) | ||
_ | a single character | Pinus s_lvestris | will find Pinus sylvestris and Pinus silvestris etc. |
[…] | any character out of a given range like [abcde] or [a-e] | Pinus s[iy]lvestris | will find Pinus sylvestris and Pinus silvestris |
[^…] | any character not in a given range like [^abcde] or [^a-e] | Pinus s[^i]lvestris | will find Pinus sylvestris but not Pinus silvestris |