ora:00936 Missing Expression error

后端 未结 1 1653
感情败类
感情败类 2021-01-23 01:00

I\'m getting ORA:00936 error for the following query.Please let me know the issue in the query

SELECT convert(DATE,r.created_dt) as created_dt,
r.created_dt as t         


        
相关标签:
1条回答
  • 2021-01-23 01:49

    SELECT convert(DATE,r.created_dt) as created_dt

    The issue is with the incorrect use of CONVERT function. Please see the documentation.

    SQL> SELECT convert(DATE,hiredate) as created_dt from emp;
    SELECT convert(DATE,hiredate) as created_dt from emp
                   *
    ERROR at line 1:
    ORA-00936: missing expression
    
    
    SQL>
    

    I guess you are trying convert the datatype, you could use TO_DATE to convert string into date. Or, TO_CHAR to do vice-versa.

    0 讨论(0)
提交回复
热议问题