Oracle日期-如何添加至今的年份 [英] Oracle Date - How to add years to date

查看:319
本文介绍了Oracle日期-如何添加至今的年份的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个日期字段

DATE = 10/10/2010

总和= 4(这是通过计算得出的年数)

sum = 4 (this are number of years by calculation)

有没有办法在2010年10月10日加上四年 2014/10/10?

is there a way to add four years to 10/10/2010 and make it 10/10/2014?

推荐答案

尝试添加几个月(12 *年).像这样-

Try adding months (12 * number of years) instead. Like this-

add_months(date'2010-10-10', 48)

这篇关于Oracle日期-如何添加至今的年份的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆