ORA-02287: 此处不允许序号
今天工作的时候遇到下面的情况:
SQL> create table daimin_1204 as
2 select DAIMIN_1204_2_ID.Nextval, t.*
3 From dlg20081105_4 t
4 order by t.出库日期
5 ;
create table daimin_1204 as
select DAIMIN_1204_2_ID.Nextval, t.*
From dlg20081105_4 t
order by t.出库日期
ORA-02287: 此处不允许序号
后来知道原因是由于sequence不能和order by ,group by同时使用,下面改为如下:
SQL> create table daimin_1204 as
2 select DAIMIN_1204_2_ID.Nextval, t.*
3 From dlg20081105_4 t
4 ;
Table created
去掉order by t.出库日期之后创建表则可以成功。