等级区间用户分布(每10级一个分区,如1-10 11-20 以此类推)
--等级区间用户分布(每10级一个分区,如1-10 11-20 以此类推)
CREATE TABLE interval_number_table04 (
employee_id NUMBER,
employee_name VARCHAR2(20),
birthday DATE
)
PARTITION BY RANGE(employee_id) INTERVAL (10) (
PARTITION partition10 VALUES LESS THAN(10)
);
用户在线时长区间分布(onlinetime单位为s,每超过1小时为一个分区)
--用户在线时长区间分布(onlinetime单位为s,每超过1小时为一个分区)
CREATE TABLE interval_number_table05 (
izoneareaid INTEGER,
onlinetime INTEGER, --在线时长
ilevel INTEGER --等级
)
PARTITION BY RANGE (onlinetime)
INTERVAL(3600) (
PARTITION part1 VALUES LESS THAN (3600)
);
iZoneAreaId每间隔数字100增加一个大分区,ilevel每间隔数字10增加一个小分区
CREATE TABLE interval_number_table06 (
izoneareaid INTEGER,
onlinetime INTEGER,
ilevel INTEGER
)
PARTITION BY RANGE (iZoneAreaId) INTERVAL (100)
SUBPARTITION BY RANGE (ilevel)
SUBPARTITION TEMPLATE (
SUBPARTITION P1 VALUES LESS THAN (10)
)
(
PARTITION part1 VALUES LESS THAN (100),
PARTITION part2 VALUES LESS THAN (200)
);