Hello,
Environment info:
- DB version: 11.2.0.2.0
I have a table with column (VARCHAR2). In this column there are: date + time + some information. For example:
05/17/2021 12:53:56 Some string.
I would like to display rows that are not older than 30 min for example.
Lets say that I want to compare results of this two queries:
SELECT TO_CHAR(SYSDATE - INTERVAL '30' minute(1), 'MM/DD/YYYY HH24:MI:SS') FROM dual;
05/18/2021 10:53:15
SELECT SUBSTR(test_string, 0, 19) FROM test_table WHERE id = 10;
05/17/2021 12:53:53
I'm stuck. I tried few different approach. For example:
SELECT * FROM test_table WHERE TO_DATE(SUBSTR(test_string, 0, 19), 'MM/DD/YYYY HH24:MI:SS') >=TO_CHAR(SYSDATE - INTERVAL '30' minute(1), 'MM/DD/YYYY HH24:MI:SS') ;
Thank you in advance for suggestions.
Lukas