<>
This page is part of MariaDB's Documentation.
The parent of this page is: SQL Operators for MariaDB Xpand
Topics on this page:
Overview
See "!=".
USAGE
value1 <> value2
Value Name | Description |
---|---|
| The two values to compare |
EXAMPLES
SELECT 42 <> 42, 1 <> 0, NULL <> NULL;
+----------+--------+--------------+
| 42 <> 42 | 1 <> 0 | NULL <> NULL |
+----------+--------+--------------+
| 0 | 1 | NULL |
+----------+--------+--------------+
-- Disable strict mode or the comparison might throw an error
SET sql_mode = '';
SELECT 99 <> '99a', 'abc' <> 0;
+-------------+------------+
| 99 <> '99a' | 'abc' <> 0 |
+-------------+------------+
| 0 | 0 |
+-------------+------------+
CREATE TABLE not_eq_example (
description VARCHAR(20),
example INT
);
INSERT INTO not_eq_example VALUES
('Everything', 42),
('Dalmations', 101),
('Agent', 99),
('B. Doz.', 13),
('CPU', 64);
SELECT *
FROM not_eq_example
WHERE example <> 101 AND description <> 'B. Doz.';
+-------------+---------+
| description | example |
+-------------+---------+
| Everything | 42 |
| Agent | 99 |
| CPU | 64 |
+-------------+---------+