Ingres在尝试查询没有时区列的时间戳时出错

时间:2012-04-19 16:18:20

标签: sql ingres

我正在尝试在“没有时区的时间戳”的时间列上写一个查询,这是我的where子句:

and (cv.expire_ts >= 'today' or ifnull(cv.expir_ts, '') = '')

我收到以下错误:

Error: 'today' is invalid format or value for timestamp without time zone or timestamp with local time zone. Please enter a valid timestamp value in yyyy-mm-dd hh:mm:ss[.fff...] format.
SQLState:  22007
ErrorCode: 4328
Error: Specified cursor is not known to the server.
SQLState:  24000
ErrorCode: 590366

如何使此查询适用于此类型的列?

2 个答案:

答案 0 :(得分:2)

尝试使用CURRENT_DATE常量,不带引号。

答案 1 :(得分:1)

我认为缺少的部分是'today'

的日期函数

Refer

相关问题