Skip to main content

IN

Tests whether the argument is or is not one of the members of an explicit list.

Syntax

<value> [ NOT ] IN ( <value1> , <value2> , ... )

Arguments

ArgumentsDescription

Return Type

Examples

mysql> SELECT * FROM numbers(10) WHERE number in (0, 1, 2, 3);
+--------+
| number |
+--------+
| 0 |
| 1 |
| 2 |
| 3 |
+--------+

mysql> SELECT * FROM numbers(10) WHERE number not in (0, 1, 2, 3);
+--------+
| number |
+--------+
| 4 |
| 5 |
| 6 |
| 7 |
| 8 |
| 9 |
+--------+