SET Type

Overview

One or more comma-separated values from a set of up to 64 pre-selected options.

USAGE

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

DETAILS

Data Type

Minimum Number of Values

Maximum Number of Values

SET

1

64

SET values can contain spaces.

SET columns can have a character set and collation.

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

EXAMPLES

Example of SET:

CREATE TABLE set_example (
   description VARCHAR(20),
   example SET('Foo', 'Bar', 'Baz', 'Bob')
);
INSERT INTO set_example VALUES
   ('1 val', 'Foo'),
   ('2 vals', 'Baz,Foo'),
   ('4 vals', 'Bob,Foo,Bar,Foo,Baz,Bob');
SELECT * FROM set_example;
+-------------+-----------------+
| description | example         |
+-------------+-----------------+
| 1 val       | Foo             |
| 2 vals      | Foo,Baz         |
| 4 vals      | Foo,Bar,Baz,Bob |
+-------------+-----------------+

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