Last active
December 24, 2015 10:17
-
-
Save laoshuterry/f668ebf3c12d349a5b4d to your computer and use it in GitHub Desktop.
利用Oracle中的last_day函数获取本月初的第一天和下月末的最后一天的格式化SQL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT to_char(last_day(add_months(sysdate,-1))+1,'yyyymmdd')||'000000' '生效日期',TO_CHAR(last_day(add_months(sysdate,1)),'yyyymmdd')||235959 '失效日期' FROM DUAL; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment