久久机这里只有精品,国产69精品一区二区亚洲孕妇,91精品国产综合久久婷婷香蕉,午夜久久久久久电影

最新活動:電腦PC端+手機端+微網站+自適應網頁多模板選擇-建站388元起價!!!
當前位置:主頁 > 網站建設 > oracle獲取上一旬的開始時間和結束時間的實現函

oracle獲取上一旬的開始時間和結束時間的實現函

時間:2023-05-22 21:05:22 閱讀: 文章分類: 網站建設 作者: 網絡小編

導讀:1建站知識本文為大家介紹下oracle如何獲取上一旬的開始時間和結束時間,實現函數如下,感興趣的朋友可以參考下如何seo優化推廣網站seo網站優化軟件。

如何seo優化推廣網站seo網站優化軟件

復制代碼 代碼如下:

-- 獲取上旬開始時間 create or replace function fd_lastxunstart(rq in date) return string is refstr varchar2(50); v_rq date; begin --獲取上一旬的日期 v_rq := trunc(rq); select case decode(trunc((to_char(v_rq, 'dd') - 1) / 10), 0, '上旬', 1, '中旬', '下旬') when '上旬' then --返回上個月的下旬 to_char(add_months(v_rq, -1), 'yyyyMM') || '21' when '中旬' then to_char(v_rq, 'yyyymm') || '01' else  to_char(v_rq, 'yyyymm') || '11' end into refstr from dual; return refstr; end fd_lastxunstaseo網站優化rt; -- 這個返回的是:上旬的開始日期 select sysdate from dual;seo網站關鍵詞優化 select fd_lastxunstart(sysdate) from dual; select fd_lastxunstart(to_date('20130305','yyyymmdd')) from dual; select fd_lastxunstart(to_date('20130311','yyyymmdd')) from dual; select fd_lastxunstart(to_date('20130325','yyyymmdd')) from dual; -- 執行結果為: 2013/9/5 12:08:39、20130821、20130221、20130301、20130311 ---- 獲取上一旬的結束日期 -- 傳遞進去 一個 date 類型的值,返回一個varchar類型的上旬結束日期 create or replace function fd_lastxunend(rq in date) return string is refstr varchar2(50); v_rq date; begin --獲取上一旬的日期 v_rq := trunc(rq); select case decode(trunc((to_char(v_rq, 'dd') - 1) / 10), 0, '上旬', 1, '中旬', '下旬') when '上旬' then --返回上個月的最后1天 --chr(39) 這個是加引號 to_char(last_day(add_months(v_rq, -1)) + 1 - 1 / 24 / 60 / 60, 'yyyymmdd') when '中旬' then to_char(v_rq, 'yyyymm') || '10' else  to_char(v_rq, 'yyyymm') || '20' end into refstr from dual; return refstr; end fd_lastxunend; -- 這個獲取的是:上旬的結束日期 select fd_lastxunend(sysdate) from dual; select fd_lastxunend(to_date('20130305','yyyymmdd')) from dual; select fd_lastxunen網seo優化趨勢d(to_date('20130311','yyyymmdd')) from dual; select fd_lastxunend(to_date('20130315','yyyymmdd')) from dual; select fd_lastxunend(to_date('20130221','yyyymmdd')) from dual; --執行結果:20130831、20130228、20130310、20130310、20130220 -- 觀察 1 / 24 / 60 / 60 的作用 這個是一秒 select last_day(add_months(trunc(sysdate), -1)) + 1 - 1 / 24 / 60 / 60 from dual; select last_day(add_months(trunc(sysdate), -1)) from dual; select last_day(add_months(trunc(sysdate), -1)) + 1 from dual; -- 執行結果:2013/8/31 23:59:59、2013/8/31、2013/9/1

相關如何seo優化推廣網站seo網站優化軟件。

關鍵詞標簽: 函數 上一

聲明: 本文由我的SEOUC技術文章主頁發布于:2023-05-22 ,文章oracle獲取上一旬的開始時間和結束時間的實現函主要講述上一,函數,oracle獲取上一旬的開始時間和結束時間網站建設源碼以及服務器配置搭建相關技術文章。轉載請保留鏈接: http://www.bifwcx.com/article/web_5285.html

我的IDC 網站建設技術SEOUC.COM
專注網站建設,SEO優化,小程序設計制作搭建開發定制網站等,數千家網站定制開發案例,網站推廣技術服務。
  • 5000+合作客服
  • 8年從業經驗
  • 150+覆蓋行業
  • 最新熱門源碼技術文章

    主站蜘蛛池模板: 永丰县| 徐汇区| 汕尾市| 南阳市| 宜州市| 江西省| 会昌县| 满洲里市| 红安县| 长乐市| 临城县| 庆阳市| 尤溪县| 巨鹿县| 赣州市| 安康市| 光泽县| 南江县| 诸暨市| 阳东县| 察隅县| 育儿| 五常市| 神农架林区| 兴和县| 张北县| 祁门县| 金湖县| 桐乡市| 绥棱县| 响水县| 朝阳县| 许昌县| 西峡县| 涟水县| 札达县| 河源市| 镇赉县| 昌都县| 麻城市| 密山市|