SQL - two months from today in Oracle

I have a column that stores the last modified date. I want to check an SQL query if its value exceeds 2 months from the current date.

I know that I need to use SYSDATE, but I am not familiar with the date material in Oracle, so I'm not sure about the rest.

+3
source share
3 answers
 SELECT * from table where date_column >= add_months(TRUNC(SYSDATE) + 1, 2);
+13
source

try it

SELECT field1,field2 from yourtable where field_date > add_months(SYSDATE, 2);

Bye

+1
source

WHERE, 13 . , 3/11/2011, 2/1/2011 EOD 2/28/2011.

SELECT * FROM [my-table] WHERE [date-field] BETWEEN TRUNC (ADD_MONTHS (SYSDATE, -13), 'MM') AND TRUNC (LAST_DAY (ADD_MONTHS (SYSDATE, -1))+1)
0

Source: https://habr.com/ru/post/1714983/


All Articles