create table range_active(
o_id number(7) not null,
o_date date,
t_amount number
);partition by range(o_date)(
partition o_a_p1 values less than (to_date('2012-12-01','yyyy-mm-dd'))
tablespace space1,
partition o_a_p2 values less than (to_date('2011-12-01','yyyy-mm-dd'))
tablespace space2,
partition o_a_p3 values less than (maxvalue) tablespace space3);
);
--报错invalid SQL statement
o_id number(7) not null,
o_date date,
t_amount number
);partition by range(o_date)(
partition o_a_p1 values less than (to_date('2012-12-01','yyyy-mm-dd'))
tablespace space1,
partition o_a_p2 values less than (to_date('2011-12-01','yyyy-mm-dd'))
tablespace space2,
partition o_a_p3 values less than (maxvalue) tablespace space3);
);
--报错invalid SQL statement
o_id number(7) not null,
o_date date,
t_amount number
);多个分号。
partition o_a_p1 values less than (to_date('2012-12-01','yyyy-mm-dd'))
tablespace space1,
partition o_a_p2 values less than (to_date('2011-12-01','yyyy-mm-dd'))
tablespace space2,
partition o_a_p3 values less than (maxvalue) tablespace space3);
);
我单独执行这个 也是报 invalid SQL statement
o_id number(7) not null,
o_date date,
t_amount number
)
;--这个分号是多余的partition by range(o_date)(partition o_a_p1 values less than (to_date('2012-12-01','yyyy-mm-dd'))
tablespace space1,
partition o_a_p2 values less than (to_date('2011-12-01','yyyy-mm-dd'))
tablespace space2,
partition o_a_p3 values less than (maxvalue) tablespace space3);
); --以上语句一起执行
partition o_a_p1 values less than (to_date('2011-12-01','yyyy-mm-dd'))
tablespace space1,
partition o_a_p2 values less than (to_date('2012-12-01','yyyy-mm-dd'))
tablespace space2,
......
o_id number(7) not null,
o_date date,
t_amount number
)partition by range(o_date)(
partition o_a_p1 values less than (to_date('2011-12-01','yyyy-mm-dd')),
partition o_a_p2 values less than (to_date('2012-01-01','yyyy-mm-dd')),
partition o_a_p3 values less than (maxvalue)
);
);这样吧