MySQL Tutorial/Comparison Functions Operators/IS — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Текущая версия на 09:49, 26 мая 2010
IS "boolean_value": Tests a value against a boolean value, where boolean_value can be TRUE, FALSE, or UNKNOWN
mysql>
mysql> SELECT 1 IS TRUE, 0 IS FALSE, NULL IS UNKNOWN;
+-----------+------------+-----------------+
| 1 IS TRUE | 0 IS FALSE | NULL IS UNKNOWN |
+-----------+------------+-----------------+
| 1 | 1 | 1 |
+-----------+------------+-----------------+
1 row in set (0.00 sec)
mysql>
IS NOT "boolean_value": Tests a value against a boolean value, where boolean_value can be TRUE, FALSE, or UNKNOWN
mysql>
mysql> SELECT 1 IS NOT UNKNOWN, 0 IS NOT UNKNOWN, NULL IS NOT UNKNOWN;
+------------------+------------------+---------------------+
| 1 IS NOT UNKNOWN | 0 IS NOT UNKNOWN | NULL IS NOT UNKNOWN |
+------------------+------------------+---------------------+
| 1 | 1 | 0 |
+------------------+------------------+---------------------+
1 row in set (0.00 sec)
mysql>