Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

Versions available for this page: CUBRID 8.4.3 | 

Retrieving Data in Partitioning

Description

When retrieving data, the SELECT statement can be used not only for partitioned tables but also for each partition.

Example

The following example shows how to create the athlete2 table to be partitioned by the list of sport events, insert data, and retrieve the event1 and event2 partitions.

CREATE TABLE athlete2( name VARCHAR(40), event VARCHAR(30) )

PARTITION BY LIST (event) (

PARTITION event1 VALUES IN ('Swimming', 'Athletics ' ),

PARTITION event2 VALUES IN ('Judo', 'Taekwondo','Boxing'),

PARTITION event3 VALUES IN ('Football', 'Basketball', 'Baseball')

);

 

INSERT INTO athlete2 VALUES ('Hwang Young-Cho', 'Athletics');

INSERT INTO athlete2 VALUES ('Lee Seung-Yuop', 'Baseball');

INSERT INTO athlete2 VALUES ('Moon Dae-Sung','Taekwondo');

INSERT INTO athlete2 VALUES ('Cho In-Chul', 'Judo');

SELECT * from athlete2__p__event1;

  name                  event

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

  'Hwang Young-Cho'     'Athletics'

 

SELECT * from athlete2__p__event2;

  name                  event

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

  'Moon Dae-Sung'       'Taekwondo'

  'Cho In-Chul'         'Judo'

Caution

For each partition of the partitioned table, direct data manipulation such as insert, update and delete is not allowed.