ORA-00904 invalid column nameCause: The column name entered is either missing or invalid. Action: Enter a valid column name. A valid column name must begin with a letter, be less 
than or equal to 30 characters, and consist of only alphanumeric characters and the 
special characters $, _, and #. If it contains other characters, it must be enclosed in 
double quotation s. It may not be a reserved word. 

解决方案 »

  1.   

    阿朱,麻烦你说的详细点,我该怎么解决。因为我觉得我的SQL语句应该是符合要求的,因为我另外一个视图和这个视图用到同样5张表,只是主外键不同,为什么会说  无效列名?!
    谢谢!
      

  2.   

    CASE 是一个关键字来的,不知是否它引起的
      

  3.   

    case是关键字原则上不适合做表名,你可以改下试试,觉得原因不在此吧。你把表结构贴出来啊,去掉是你写错了这个可能性。ORA-00904 出错一般就是列名有问题。别的还真看不出来哪有错。
      

  4.   

    对,把表中的EQUIPMENTTYPEID记成EQUIPMENTID了,但是,我改过以后又出现一个错误:
    ORA——01730,指定的列名数无效。
    现在的SQL语句缩短了:
    select b.casesymptomid,a.caseid,a.casename,c.symptomid,c.symptomname,c.symptomdescription,b.casesymptomproportion,d.equipmenttypecode,d.equipmenttypeid 
    from case a,case_symptom b,symptom c,equipment_type d 
    where a.caseid=b.caseid 
    and b.symptomid(+)=c.symptomid 
    and c.equipmenttypeid(+)=d.equipmenttypeid
      

  5.   

    你把select项b.casesymptomid,a.caseid,a.casename,c.symptomid,c.symptomname,c.symptomdescription,b.casesymptomproportion,d.equipmenttypecode,d.equipmenttypeid 从一个开始测,一个一个加。试试。
    是不是建视图时出错了?
      

  6.   

    建视图不能用类似创建的吗?直接用SQL语句?还是我弱智到漏掉什么重要的步骤?!还请阿朱说说建立视图的各种方法!谢谢了!分太少可以加,呵呵,在我有的情况下!:))
      

  7.   

    应该是CASE不能用关键做表名
    就应该是这理
    如果还是不对226512144QQ
    [email protected]
    和我联系好吗