I have a query that involves a where clause which i compare two columns that have DATE
as their data type. these are last_collected_date
and update_date
.
SELECT *
FROM mytable
WHERE last_collected_date < update_date;
The weird thing is that this does not work as expected and I get dates of last_collected_date
that have the same day as update_date
.
However when I use to_date
function:
SELECT *
FROM mytable
WHERE to_date(last_collected_date) < to_date(update_date);
It works as expected. Why is that ? Does oracle convert dates into strings internally in a select statement ?
This is my NLS settings. Is that reason I dont see my hh:mi:ss
?