首页 > 解决方案 > where 条件 - ORA-01861: 文字与格式字符串不匹配

问题描述

在我的 where 条件下,我需要检查特定日期列不等于特定日期.. 我该怎么做

目前我已经写了

gsaTs.X_GSA_ARRIVE_ONSITE <> '1753/01/01'

我收到以下错误

[Error] Execution (189: 49): ORA-01861: literal does not match format string

标签: sqloracle

解决方案


尝试使用to_date()并指定匹配的格式字符串。

gsaTs.X_GSA_ARRIVE_ONSITE <> to_date('1753/01/01', 'YYYY/MM/DD')

推荐阅读