距离下个结婚纪念日还有多少天

今天比较闲,就写了一个SQL来实现距离下个结婚纪念日还有多少天。跟老婆经历了风风雨雨,我们终于走到了一起,希望你能够幸福、健康。我们会永远快乐的生活,不会在让你受到任何伤害。老婆,我爱你。

select ceil(to_date((case when to_number(to_char(sysdate,'mm'))<2 then to_char(sysdate,'yyyy')
                          when to_number(to_char(sysdate,'mm'))=2 and to_number(to_char(sysdate,'dd'))<=26 then to_char(sysdate,'yyyy')
                     else to_char(to_number(to_char(sysdate,'yyyy')) + 1) end)||'0206','yyyymmdd') - sysdate)
from dual;

请使用浏览器的分享功能分享到微信等