<small id='5BL2v'></small><noframes id='5BL2v'>

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

        • <bdo id='5BL2v'></bdo><ul id='5BL2v'></ul>

        Oracle:如何减去两个日期并获得结果的分钟数

        Oracle : how to subtract two dates and get minutes of the result(Oracle:如何减去两个日期并获得结果的分钟数)
          • <tfoot id='f1big'></tfoot>
              <bdo id='f1big'></bdo><ul id='f1big'></ul>

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

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

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

                  本文介绍了Oracle:如何减去两个日期并获得结果的分钟数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我编写了这个函数来获取某个日期的分钟数,但我无法获取两个日期之间的分钟数,如何获取?

                  I wrote this function to get minutes from a date, but I cannot get minutes between two dates, How to get that ?

                  FUNCTION get_minute(p_date DATE)
                  RETURN NUMBER
                  IS
                  BEGIN
                      IF p_date IS NOT NULL THEN
                          return  EXTRACT(MINUTE FROM TO_TIMESTAMP(to_char(p_date,'DD-MON-YYYY HH:MI:SS'),'DD-MON-YYYY HH24:MI:SS'));
                      ELSE
                          RETURN 0;
                      END IF;
                  END get_minute;
                  

                  推荐答案

                  当你在 Oracle 中减去两个日期时,你会得到两个值之间的天数.所以你只需要在几分钟内乘以得到结果:

                  When you subtract two dates in Oracle, you get the number of days between the two values. So you just have to multiply to get the result in minutes instead:

                  SELECT (date2 - date1) * 24 * 60 AS minutesBetween
                  FROM ...
                  

                  这篇关于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 中的重置序列)
                  <i id='tUKnX'><tr id='tUKnX'><dt id='tUKnX'><q id='tUKnX'><span id='tUKnX'><b id='tUKnX'><form id='tUKnX'><ins id='tUKnX'></ins><ul id='tUKnX'></ul><sub id='tUKnX'></sub></form><legend id='tUKnX'></legend><bdo id='tUKnX'><pre id='tUKnX'><center id='tUKnX'></center></pre></bdo></b><th id='tUKnX'></th></span></q></dt></tr></i><div id='tUKnX'><tfoot id='tUKnX'></tfoot><dl id='tUKnX'><fieldset id='tUKnX'></fieldset></dl></div>

                          <tbody id='tUKnX'></tbody>

                          <bdo id='tUKnX'></bdo><ul id='tUKnX'></ul>
                        • <tfoot id='tUKnX'></tfoot>

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

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