<small id='deuWC'></small><noframes id='deuWC'>

<legend id='deuWC'><style id='deuWC'><dir id='deuWC'><q id='deuWC'></q></dir></style></legend>

    <bdo id='deuWC'></bdo><ul id='deuWC'></ul>

  • <tfoot id='deuWC'></tfoot>
      <i id='deuWC'><tr id='deuWC'><dt id='deuWC'><q id='deuWC'><span id='deuWC'><b id='deuWC'><form id='deuWC'><ins id='deuWC'></ins><ul id='deuWC'></ul><sub id='deuWC'></sub></form><legend id='deuWC'></legend><bdo id='deuWC'><pre id='deuWC'><center id='deuWC'></center></pre></bdo></b><th id='deuWC'></th></span></q></dt></tr></i><div id='deuWC'><tfoot id='deuWC'></tfoot><dl id='deuWC'><fieldset id='deuWC'></fieldset></dl></div>

      1. 使用 DBMS_RANDOM 在 Oracle 中生成随机日期

        Generate a random date in Oracle with DBMS_RANDOM(使用 DBMS_RANDOM 在 Oracle 中生成随机日期)
      2. <legend id='LCMhb'><style id='LCMhb'><dir id='LCMhb'><q id='LCMhb'></q></dir></style></legend>
            <bdo id='LCMhb'></bdo><ul id='LCMhb'></ul>

                • <tfoot id='LCMhb'></tfoot>
                • <i id='LCMhb'><tr id='LCMhb'><dt id='LCMhb'><q id='LCMhb'><span id='LCMhb'><b id='LCMhb'><form id='LCMhb'><ins id='LCMhb'></ins><ul id='LCMhb'></ul><sub id='LCMhb'></sub></form><legend id='LCMhb'></legend><bdo id='LCMhb'><pre id='LCMhb'><center id='LCMhb'></center></pre></bdo></b><th id='LCMhb'></th></span></q></dt></tr></i><div id='LCMhb'><tfoot id='LCMhb'></tfoot><dl id='LCMhb'><fieldset id='LCMhb'></fieldset></dl></div>

                    <tbody id='LCMhb'></tbody>

                  <small id='LCMhb'></small><noframes id='LCMhb'>

                • 本文介绍了使用 DBMS_RANDOM 在 Oracle 中生成随机日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有这个匿名块:

                  DECLARE
                     V_DATA   DATE;
                  BEGIN
                     V_DATA := '01-GEN-2000';
                  
                     HR.STATISTICHE.RATINGOPERATORI (V_DATA);
                     COMMIT;
                  END;
                  

                  但我会以随机方式生成日期.我该怎么办?

                  but I would to generate the date in a random way. How can I do?

                  推荐答案

                  您可以在两个日期之间生成随机日期,如下面的查询所示.随机日期在 1-jan-2000 和 31-dec-9999 之间生成

                  You can generate random dates between two dates ,as displayed in the query below .Random Dates are generated between 1-jan-2000 and 31-dec-9999

                    SELECT TO_DATE(
                                TRUNC(
                                     DBMS_RANDOM.VALUE(TO_CHAR(DATE '2000-01-01','J')
                                                      ,TO_CHAR(DATE '9999-12-31','J')
                                                      )
                                      ),'J'
                                 ) FROM DUAL;
                  

                  或者你可以使用

                  SELECT TO_DATE (
                                TRUNC (
                                       DBMS_RANDOM.VALUE (2451545, 5373484) 
                                      )
                                  , 'J'
                                )
                    FROM DUAL
                  

                  在上面的例子中,第一个值是 01-Jan-2000,第二个值是 31-dec-9999

                  In the above example ,the first value is 01-Jan-2000 and the second value id 31-dec-9999

                  这篇关于使用 DBMS_RANDOM 在 Oracle 中生成随机日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  How to redirect the output of DBMS_OUTPUT.PUT_LINE to a file?(如何将 DBMS_OUTPUT.PUT_LINE 的输出重定向到文件?)
                  How do I get column datatype in Oracle with PL-SQL with low privileges?(如何使用低权限的 PL-SQL 在 Oracle 中获取列数据类型?)
                  Get a list of all functions and procedures in an Oracle database(获取 Oracle 数据库中所有函数和过程的列表)
                  Why cannot I create triggers on objects owned by SYS?(为什么我不能在 SYS 拥有的对象上创建触发器?)
                  Returning result even for elements in IN list that don#39;t exist in table(即使对于表中不存在的 IN 列表中的元素也返回结果)
                  Reset Sequence in oracle 11g(oracle 11g 中的重置序列)

                    <small id='X38J4'></small><noframes id='X38J4'>

                    <legend id='X38J4'><style id='X38J4'><dir id='X38J4'><q id='X38J4'></q></dir></style></legend>
                      <tbody id='X38J4'></tbody>
                    <tfoot id='X38J4'></tfoot>

                          • <bdo id='X38J4'></bdo><ul id='X38J4'></ul>
                          • <i id='X38J4'><tr id='X38J4'><dt id='X38J4'><q id='X38J4'><span id='X38J4'><b id='X38J4'><form id='X38J4'><ins id='X38J4'></ins><ul id='X38J4'></ul><sub id='X38J4'></sub></form><legend id='X38J4'></legend><bdo id='X38J4'><pre id='X38J4'><center id='X38J4'></center></pre></bdo></b><th id='X38J4'></th></span></q></dt></tr></i><div id='X38J4'><tfoot id='X38J4'></tfoot><dl id='X38J4'><fieldset id='X38J4'></fieldset></dl></div>