擷取指定日期的隨機時間(oracle函數),oracle函數

來源:互聯網
上載者:User

擷取指定日期的隨機時間(oracle函數),oracle函數

原文地址——http://blog.csdn.net/qq525099302/article/details/47146067

/*v_date  'yyyy-mm-dd'格式的日期文字v_begin 隨機日期的相對最小值,單位為天,預設0v_end   隨機日期的相對最大值,單位為天,預設1*/create or replace function r_time (v_date in varchar2, v_begin in number := 0, v_end in number := 1) return dateis  r_date date ;begin  SELECT to_date(v_date,'yyyy-mm-dd') + DBMS_RANDOM.VALUE(v_begin ,v_end) into r_date FROM dual;  return r_date ;end r_time;

著作權聲明:本文為博主原創文章,未經博主允許不得轉載。

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.