Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

Versions available for this page: CUBRID 8.2.1 |  CUBRID 8.3.0 |  CUBRID 8.3.1 |  CUBRID 8.4.0 |  CUBRID 8.4.1 |  CUBRID 8.4.3 |  CUBRID 9.0.0 | 

MULTISET

Description

MULTISET is a collection type in which duplicated elements are allowed. Elements of a MULTISET can have many different data types or even records of different tables.

Example

CREATE TABLE multiset_tbl ( col_1 multiset(int, CHAR(1)));

INSERT INTO multiset_tbl VALUES ({3,3,3,2,2,1,0,'c','c','c','b','b', 'a'});

SELECT * FROM multiset_tbl;

  col_1

======================

  {0, 1, 2, 2, 3, 3, 3, 'a', 'b', 'b', 'c', 'c', 'c'}

 

SELECT CAST(col_1 AS SET), CAST(col_1 AS LIST) FROM multiset_tbl;

   cast(col_1 as set)   cast(col_1 as sequence)

============================================

  {0, 1, 2, 3, 'a', 'b', 'c'}  {3, 3, 3, 2, 2, 1, 0, 'c', 'c', 'c', 'b', 'b', 'a

'}