例子:
查询下周的人的生日条件:
to_char(sysdate,'yyyy')||substr(t1.birthday,5,4)
between to_char(trunc(sysdate)+7-decode(to_char(sysdate,'d'),1,6,to_char(sysdate,'d')-2),'yyyymmdd')
and to_char(trunc(sysdate)+14-decode(to_char(sysdate,'d'),1,6,to_char(sysdate,'d')-1),'yyyymmdd')
DECODE(value,if1,then1,if2,then2,if3,then3,...,else),表示如果value等于if1时,DECODE函数的结果返回then1,...,如果不等于任何一个if值,则返回else