在Oracle中建立新表时,如用到了以保留字命名的字段,可用""进行建表。
  但是如果原表中的字段命是保留字,如何读取呀?
  我用[]、表名.字段名和"" 都不能读取,在SQL*PLUS中运行带有字段命是保留字的SQL语句都是错误的。
  哪位高人能给指点一下,在些先谢了?

解决方案 »

  1.   

    SQL> create table wiler_tta ( "create" varchar2(30) ) ;表已创建。SQL> select "create" from wiler_tta;未选定行SQL>
      

  2.   

    select t."create" from wiler_tta t
    这样就可以啦
      

  3.   

    SQL> create table test00("create" number);Table createdSQL> insert into test00 values(55);1 row insertedSQL> commit;Commit completeSQL> select * from test00;    create
    ----------
            55SQL> select "create" from test00;    create
    ----------
            55
      

  4.   


    以下测试在oracle9i和10g下都成功
    SQL> create table aa("create" int);Table createdSQL> insert into aa select 1 from dual;1 row insertedSQL> commit;Commit completeSQL> select "create" from aa ;                                 create
    ---------------------------------------
                                          1