expr IN (value,...)
IN list, else it
returns 0. If all values are constants, then all values are evaluated
according to the type of expr and sorted. The search for the item is
then done by using a binary search. This means IN is very quick
when used with constants in the IN part.
mysql> select 2 in (0,3,5,'wefwf'); -> 0 mysql> select 'wefwf' in (0,3,5,'wefwf'); -> 1
expr NOT IN (value,...)
NOT (expr IN (value,...))
expr LIKE expr
LIKE you have two wild characters.
% | Matches any number of characters, even zero characters. |
_ | Matches exactly one character. |
\% | Matches one %.
|
\_ | Matches one _.
|
mysql> select 'David!' like 'David_'; -> 1 mysql> select 'David!' like 'David\_'; -> 0 mysql> select 'David_' like 'David\_'; -> 1 mysql> select 'David!' like '%D%v%'; -> 1 mysql> select 10 like '1%'; -> 1
LIKE is allowed on numerical expressions! (Extension)
NOT (expr LIKE expr).
RLIKE
is for mSQL compatibility. NOTE: Because MySQL uses the
C escape syntax in strings (\n) You must double any '\'
that you uses in your REGEXP strings.
mysql> select 'Monty!' regexp 'm%y%%'; -> 0 mysql> select 'Monty!' regexp '.*'; -> 1 mysql> select 'new*\n*line' regexp 'new\\*.\\*line'
NOT (expr REGEXP expr).
mysql> select strcmp('text', 'text2'); -> -1
mysql> select strcmp('text2', 'text'); -> 1
mysql> select strcmp('text', 'text'); -> 0
Go to the first, previous, next, last section, table of contents.