SQL> create global temporary table temp_audits
2 as
3 select *,row_number() over(order by time) id from audits;
select *,row_number() over(order by time) id from audits
*
ERROR at line 3:
ORA-00923: FROM keyword not found where expected
oracle的临时表这样用的
create temporary table tb
as
SELECT * FROM audits ORDER BY time
on commit presever rows;
或
create temporary table tb
as
SELECT * FROM audits ORDER BY time
on commit delete rows;
SQL> create global temporary table temp_audits
2 on commit preserve rows
3 as
4 select * from audits;
select * from audits
*
ERROR at line 4:
ORA-01723: zero-length columns are not allowed
[/Quote]
我找到原因是因为audits这张表有一个字段定义的时候用NULL,那么如何解决啊
SQL> create global temporary table temp_audits
2 on commit preserve rows
3 as
4 select * from audits;
select * from audits
*
ERROR at line 4:
ORA-01723: zero-length columns are not allowed