SQL-从今天起在Oracle中两个月 [英] SQL - two months from todays date in Oracle

查看:95
本文介绍了SQL-从今天起在Oracle中两个月的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一列存储上次修改日期.我想在SQL查询中检查其值是否距离当前日期超过2个月.

I have a column that stores the last modified date. I want to check in a SQL query if its value is more than 2 months from the current date.

我知道我需要使用SYSDATE,但不熟悉Oracle中的日期,因此不确定其余内容.

I know I need to use SYSDATE but am not familiar with date stuff in Oracle so am unsure as to the rest.

推荐答案

 SELECT * from table where date_column >= add_months(TRUNC(SYSDATE) + 1, 2);

这篇关于SQL-从今天起在Oracle中两个月的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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