Versions available for this page: CUBRID 8.3.1 | CUBRID 8.4.0 | CUBRID 8.4.1 | CUBRID 8.4.3 | CUBRID 9.0.0 |
LIST (=SEQUENCE) is a collection type in which the input order of elements is preserved, and duplications are allowed. Elements of a LIST can have many different data types or even instances of different classes.
csql> CREATE TABLE list_tbl ( col_1 list(int, CHAR(1)));
csql> INSERT INTO list_tbl VALUES ({3,3,3,2,2,1,0,'c','c','c','b','b', 'a'});
csql> SELECT * FROM list_tbl;
csql> ;xr
=== <Result of SELECT Command in Line 1> ===
col_1
======================
{3, 3, 3, 2, 2, 1, 0, 'c', 'c', 'c', 'b', 'b', 'a'}
csql> SELECT CAST(col_1 AS SET), CAST(col_1 AS MULTISET) FROM list_tbl;
csql> ;xr
=== <Result of SELECT Command in Line 1> ===
cast(col_1 as set) cast(col_1 as multiset)
============================================
{0, 1, 2, 3, 'a', 'b', 'c'} {0, 1, 2, 2, 3, 3, 3, 'a', 'b', 'b', 'c', 'c', 'c
'}