I meant for the following query (run on a friday) to return "FRIDAY" in the first column and "1" in the second column. It returns FRIDAY alright, but in the second column returns 0. Can anyone tell my why and how to fix it?
SELECT a.dayofweek, (CASE WHEN a.dayofweek = 'FRIDAY' THEN 1 ELSE 0 END) daynum
FROM (SELECT TO_CHAR(sysdate ,'DAY') as dayofweek
FROM dual
) a