Datetime trunc in where clase
I am writing and comparing results of two queries:
select to_char(cast((from_tz(ntimestamp# ,'00:00') at local) as date) ,'YYYY-MM-DD HH24:MI:SS') from sys.aud$
where cast((from_tz(ntimestamp# ,'00:00') at local) as date) < to_char(trunc(sysdate - 1, 'DD'), 'YYYY-MON-DD HH24:MI:SS')
order by ntimestamp# asc;
TO_CHAR(CAST((FROM_
-------------------
2017-08-13 23:59:40
2017-08-13 23:59:40
2017-08-13 23:59:41
2017-08-13 23:59:41
2017-08-13 23:59:41
2017-08-13 23:59:41
2017-08-13 23:59:42
2017-08-13 23:59:42
2017-08-13 23:59:43
2017-08-13 23:59:43
and
select to_char(cast((from_tz(ntimestamp# ,'00:00') at local) as date) ,'YYYY-MM-DD HH24:MI:SS') from sys.aud$