简体   繁体   English

使用“create as”语句创建索引组织表的 Oracle 问题

[英]Oracle problem creating index organized table using "create as" statement

So I'm trying to create a copy of one of my tables into an index organized table, However I get an error, here is the code.所以我试图将我的一个表的副本创建到索引组织的表中,但是我收到一个错误,这是代码。

create table clients2 as
select *
from clients
organization index;

ORA-00933:"SQL command not properly ended" ORA-00933:"SQL 命令未正确结束"

Your command is wrong.你的命令是错误的。

SQL> create table testiot ( object_id primary key,object_name ) 
     organization index 
     as select object_id,object_name from dba_objects 
     where object_id is not null ;

Table created.

SQL> select count(*) from testiot ;

  COUNT(*)
----------
    208730

Organization index must be in the definition of the table and before as select . Organization index必须在表的定义中并且之前as select On the other hand, you need to define the columns in the table and which one is the primary key for IOT.另一方面,您需要定义表中的列以及哪些是 IOT 的主键。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM