【发布时间】:2021-07-27 12:53:01
【问题描述】:
我正在尝试在 postgresql 中使用子字符串函数,但错误是
'没有函数匹配给定的名称和参数类型。您可能需要添加显式类型转换。'
这是代码
select order_id, ship_date,
Substring (ship_date from 5 for 2) as month
from tewt
order by ship_date;
对此的任何建议都会有所帮助。
【问题讨论】:
-
为什么不使用日期函数来提取月份?
-
样本数据、所需结果以及解释
ship_date的类型都会有所帮助。 -
当您在 Stackoverflow 上提问时,请添加您的示例数据并解释您想要的结果并添加您的预期结果。
标签: sql postgresql substring