ENUM

Overview

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

USAGE

ENUM('<value_1>', '<value_2>', ...)
   [{CHARACTER SET | CHARSET} <charset_name>]
   [COLLATE <collation_name>]

DETAILS

Data Type

Minimum Number of Values

Maximum Number of Values

ENUM

1

65,535

ENUM values can contain spaces.

ENUM columns can have a character set and collation.

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

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  |
+-------------+---------+

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