为了账号安全,请及时绑定邮箱和手机立即绑定

为什么日期函数加一天查不出来?

为什么日期函数加一天查不出来?

慕斯王 2022-06-17 15:11:47
select DateAdd (expire_date,1,'2012-06-24'),expire_date from A 为什么查不出来ERROR: function dateadd(timestamp with time zone, integer, unknown) does not existLINE 2: select DateAdd (expire_date,1,'2012-06-24'),expire_date from...^HINT: No function matches the given name and argument types. You might need to add explicit type casts.********** 错误 **********ERROR: function dateadd(timestamp with time zone, integer, unknown) does not existSQL 状态: 42883指导建议:No function matches the given name and argument types. You might need to add explicit type casts.字符:9
查看完整描述

2 回答

?
慕妹3242003

TA贡献1824条经验 获得超6个赞

select DateAdd (expire_date,1,'2012-06-24'),expire_date from A
你这个语句中第一个参数你对不对暂时还看不出,但是最后一个参数你传入的是一个字符串 ,它需要的是个日期格式.当然就不行了,需要转换,还有,如果你只是加一天的话,第一个参数固定写成day就可以

查看完整回答
反对 回复 2022-06-20
?
慕标琳琳

TA贡献1830条经验 获得超9个赞

select expire_date +1,expire_date from A
即可,oracle的日期能够直接相加

查看完整回答
反对 回复 2022-06-20
  • 2 回答
  • 0 关注
  • 164 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信