I'm running into some unexpected behavior, which doesn't make any sense to me.
I have a table with a TIMESTAMP(6)
column.
If I execute the following query:
SELECT DISTINCT TO_CHAR(ssef.SS_TIMESTAMP, 'DAY') FROM SS_EDGE_FORECAST ssef
I get the following results:
FRIDAY
TUESDAY
SUNDAY
SATURDAY
MONDAY
THURSDAY
So far so good.
However, if I try to filter my query results by specifying a specific weekday in the WHERE
clause, I get no results:
SELECT * FROM SS_EDGE_FORECAST ssef
WHERE TO_CHAR(ssef.SS_TIMESTAMP, 'DAY') = 'MONDAY'
This appears to be a direct contradiction.
Why would the TO_CHAR
operation produce the correct results in the SELECT
clause, but not in the WHERE
clause?
Why would I be able to select something, but NOT be able to filter based on that same item?