SET Type
This page is part of MariaDB's Documentation.
The parent of this page is: Data Types for MariaDB Enterprise Server
Topics on this page:
Overview
One or more comma-separated values from a set of up to 64 pre-selected options.
EXAMPLES
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 |
+-------------+-----------------+
CHANGE HISTORY
EXTERNAL REFERENCES
Additional information on this topic may be found in the MariaDB Public Knowledge Base.