ENUM

Overview

A single value from up to 65,535 pre-selected options.

See also: Data Types in Xpand 6 and in 5.3

EXAMPLES

Example of ENUM:

CREATE TABLE enum_example (
  description VARCHAR(20),
  example ENUM('Alpha', 'Beta', 'Gamma', 'RC', 'Stable')
);
INSERT INTO enum_example VALUES
  ('foo', 'Beta'),
  ('bar', 'RC'),
  ('baz', 'Alpha'),
  ('bob', 5);
SELECT * FROM enum_example;
+-------------+---------+
| description | example |
+-------------+---------+
| foo         | Beta    |
| bar         | RC      |
| baz         | Alpha   |
| bob         | Stable  |
+-------------+---------+

CHANGE HISTORY

Release Series

History

6

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

EXTERNAL REFERENCES