NOT LIKE

USAGE

value NOT LIKE text
value NOT LIKE text ESCAPE character

Value Name

Description

value

A value expression

text

A text string with optional wildcards

DETAILS

The NOT LIKE operator works in a similar manner to the LIKE operator but with the opposite return value. See that operator's description for how the wildcard text and optional escape character works.

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

EXAMPLES

CREATE TABLE not_like_example (
  description VARCHAR(20),
  example INT
);
INSERT INTO not_like_example VALUES
  ('Everything', 42),
  ('Dalmations', 101),
  ('Agent', 99),
  ('100% Done', 13),
  ('CPU', 64);
SELECT *
FROM not_like_example
WHERE description NOT LIKE '%ing'
  AND description NOT LIKE '____t%';
+-------------+---------+
| description | example |
+-------------+---------+
| Dalmations  |     101 |
| 100% Done   |      13 |
| CPU         |      64 |
+-------------+---------+
-- Match descriptions without a percent
SELECT *
FROM not_like_example
WHERE description NOT LIKE '%\\%%';
+-------------+---------+
| description | example |
+-------------+---------+
| Everything  |      42 |
| Dalmations  |     101 |
| Agent       |      99 |
| CPU         |      64 |
+-------------+---------+
-- Match descriptions without a percent using alternate escape character
SELECT *
FROM not_like_example
WHERE description NOT LIKE '%=%%' ESCAPE '=';
+-------------+---------+
| description | example |
+-------------+---------+
| Everything  |      42 |
| Dalmations  |     101 |
| Agent       |      99 |
| CPU         |      64 |
+-------------+---------+

ERROR HANDLING

FEATURE INTERACTION

RESPONSES

DIAGNOSIS

ISO 9075:2016

CHANGE HISTORY

Release Series

History

23.09

  • Present starting in MariaDB Xpand 23.09.1.

6.1

  • Present starting in MariaDB Xpand 6.1.0.

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.1

  • Present starting in MariaDB Xpand 6.1.0.

EXTERNAL REFERENCES