MySQL Tutorial/Comparison Functions Operators/Not equal — различия между версиями

Материал из SQL эксперт
Перейти к: навигация, поиск
м (1 версия)
 
м (1 версия)
 
(нет различий)

Текущая версия на 09:49, 26 мая 2010

Compare string value using the Not equal operator

mysql>
mysql> SELECT "AB" <> "ABC";
+---------------+
| "AB" <> "ABC" |
+---------------+
|             1 |
+---------------+
1 row in set (0.00 sec)
mysql>


Data type conversion in Not equal operator

mysql>
mysql> SELECT ".01" <> "0.01";
+-----------------+
| ".01" <> "0.01" |
+-----------------+
|               1 |
+-----------------+
1 row in set (0.00 sec)


Not equal: <> or !=

mysql>
mysql>
mysql> SELECT 1 <> 2;
+--------+
| 1 <> 2 |
+--------+
|      1 |
+--------+
1 row in set (0.00 sec)
mysql>
mysql>
mysql>


SELECT .01 <> "0.01";

mysql>
mysql>
mysql>
mysql> SELECT .01 <> "0.01";
+---------------+
| .01 <> "0.01" |
+---------------+
|             0 |
+---------------+
1 row in set (0.00 sec)
mysql>


String comparisons are not case sensitive

mysql>
mysql> SELECT "AB" <> "ab";
+--------------+
| "AB" <> "ab" |
+--------------+
|            0 |
+--------------+
1 row in set (0.00 sec)
mysql>
mysql> SELECT "AB" = "ab";
+-------------+
| "AB" = "ab" |
+-------------+
|           1 |
+-------------+
1 row in set (0.00 sec)
mysql>