表中有个字段名date,
select * from t order by date 会报错:缺失表达式......
怎么办?

解决方案 »

  1.   


    select * from t order by "date"
      

  2.   

    select * from t order by "date"加上引号,另外注意大小写
      

  3.   

    SQL> select * from t1;date
    ---------------
    24-DEC-09
    25-DEC-09
    SQL> select * from t1 order by date;
    select * from t1 order by date
                              *
    ERROR at line 1:
    ORA-00936: missing expression
    SQL> select * from t1 order by "date";date
    ---------------
    24-DEC-09
    25-DEC-09
      

  4.   

    这是关键字,加双引号,注意大小写
    select * from t order by "date" 
      

  5.   

    date 关键字 如果要用 就要加上引号 以区别 ,建议最好不用
      

  6.   

    date是关键字 建表应该用D_开头比较好用。
      

  7.   

    date是oracle的关键字,最好是不用,如果硬要用的话只能是“date”