【问题标题】:Oracle select column with special nameOracle 选择具有特殊名称的列
【发布时间】:2011-10-24 10:28:22
【问题描述】:

我有一个视图,其中包含一个名为“Started At”的列。如何在 SELECT 语句中选择它?

谢谢!

【问题讨论】:

    标签: database oracle view


    【解决方案1】:

    试试

    SELECT "Started At"
    FROM your_table
    

    【讨论】:

      【解决方案2】:

      您可以通过将名称括在双引号中来打破 Oracle 数据库模式对象名称规则(无保留字、以 A-Z 开头、长度为 30 个字符等)。要稍后访问该对象,您必须用双引号将名称括起来。

      重点:

      me@XE> create table t ("x" int);
      
      Table created.
      
      me@XE> select x from t;
      
      select x from t
             *
      ERROR at line 1:
      ORA-06553: PLS-306: wrong number or types of arguments in call to 'OGC_X'
      
      
      me@XE> select "x" from t;
      
      no rows selected
      
      me@XE> create view v as select * from t;
      
      View created.
      
      me@XE> select x from v;
      
      select x from v
             *
      ERROR at line 1:
      ORA-06553: PLS-306: wrong number or types of arguments in call to 'OGC_X'
      
      
      me@XE> select "x" from v;
      
      no rows selected
      
      me@XE>
      

      【讨论】:

        猜你喜欢
        • 2022-06-10
        • 2016-08-05
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-05-21
        • 1970-01-01
        • 1970-01-01
        • 2017-10-14
        相关资源
        最近更新 更多