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

解决方案 »

  1.   

    create table range_active(
      o_id number(7) not null,
      o_date date,
      t_amount number
    );多个分号。
      

  2.   

    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
      

  3.   

    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);
    ); --以上语句一起执行
     
      

  4.   

    這兩個日期是不是也要調換一下位置
    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,
    ......
     
      

  5.   

    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('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)
      );
    );这样吧