0

How can I extract only the records of the last 30 days in a manner that it is automatically updated whenever I run the query?

I'm using Oracle

Thank you so much

Andrea Zed
  • 23
  • 5
  • Possible duplicate of [Subtracting Number of Days from a Date in PL/SQL](https://stackoverflow.com/questions/19523019/subtracting-number-of-days-from-a-date-in-pl-sql) – araknoid Aug 24 '17 at 09:46

2 Answers2

0

You can try the following ---

SELECT * 
FROM TABLENAME
WHERE DATECOLUMN >= SYSDATE - 30;
-1

Try this:

SELECT *
FROM Table
WHERE Table.ColumnName >= DATEADD(DAY, -30, GETDATE())
travis_91
  • 171
  • 2
  • 13