create table test_ppi (
pi_field integer,
effective_Start_date date,
last_updated_date date
)
PRIMARY INDEX (pi_field)
PARTITION BY (
RANGE_N(effective_Start_date between date '2008-01-01' and date '2013-12-01' each interval '1' month),
RANGE_N(last_updated_date between date '2008-01-01' and date '2013-12-01' each interval '1' month)
)
;
insert into test_ppi values (1,date'2008-01-01',date'2008-01-01');
insert into test_ppi values (2,date'2010-01-01',date'2010-01-01');
show table test_ppi;
-- old
alter table test_ppi modify primary index
add range between date '2006-01-01' and '2007-12-31' each interval '1' month;
show table test_ppi;
-- new
create table test_ppi (
pi_field integer,
effective_Start_date date,
last_updated_date date
)
PRIMARY INDEX (pi_field)
PARTITION BY (
RANGE_N(effective_Start_date between date '2008-01-01' and date '2013-12-01' each interval '1' month),
RANGE_N(last_updated_date between date '2008-01-01' and date '2013-12-01' each interval '1' month)
)
;
insert into test_ppi values (1,date'2008-01-01',date'2008-01-01');
insert into test_ppi values (2,date'2010-01-01',date'2010-01-01');
show table test_ppi;
-- old
alter table test_ppi modify primary index
add range between date '2006-01-01' and '2007-12-31' each interval '1' month;
show table test_ppi;
-- new