SQL: 函数 trunc(没有时区的时间戳,"unknown") 不存在
SQL: function trunc(timestamp without time zone, "unknown") does not exist
我正在尝试使用以下代码将日期列转换为星期:
select trunc(join_date, 'D') as join_wk from my_table
但是我得到了以下错误:
function trunc(timestamp without time zone, "unknown") does not exist
Hint: No function matches the given name and argument types. You may need to add explicit type casts.
其中 join_date
的格式为:
2017-08-24 14:49:59
我在查询中做错了什么?谢谢!
函数名是date_trunk
,你要交换参数:
SELECT DATE_TRUNC('D', join_date) AS join_wk FROM my_table
我正在尝试使用以下代码将日期列转换为星期:
select trunc(join_date, 'D') as join_wk from my_table
但是我得到了以下错误:
function trunc(timestamp without time zone, "unknown") does not exist
Hint: No function matches the given name and argument types. You may need to add explicit type casts.
其中 join_date
的格式为:
2017-08-24 14:49:59
我在查询中做错了什么?谢谢!
函数名是date_trunk
,你要交换参数:
SELECT DATE_TRUNC('D', join_date) AS join_wk FROM my_table