Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> strange behavior of decode?
can anyone explain to me why this does not work:
select to_char(sysdate,'Day') from dual; output -> Friday
select decode(to_char(sysdate,'Day'),'Friday',1,2) from dual; output -> 2
why is the output not 1?
if i do:
select decode(to_char(sysdate,'Dy'),'Fri',1,2) from dual;
output -> 1
why does the decode work in this case but not the previous?
any help would be much appreciated.
-maurice
samuels_at_seas.upenn.edu
Received on Fri Aug 11 2000 - 00:00:00 CDT
![]() |
![]() |