I the following query:
SELECT
trunc(estimatedenddate,'hh') AS reg_date,
COUNT(*)
FROM
(
SELECT
attr_value,
TO_DATE( (DATE '1970-01-01' + (1 / 24 / 60 / 60 / 1000) * attr_value),'yyyy-mm-dd HH24:mi:ss') AS estimatedenddate
FROM
attr
WHERE
attr_name = 'createTimestamp'
)
WHERE
estimatedenddate > TO_DATE('01/JUN/2018','dd/mon/yyyy')
GROUP BY
trunc(estimatedenddate,'hh')
ORDER BY
reg_date DESC;
It works when I set the NLS_DATE_FORMAT. See dbfiddle.
However if I do not set the NLS_DATE_FORMAT, the query doesn't produce any results. See dbfiddle
How can I modify this query such that it works without setting the NLS_DATE_FORMAT?