<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:如何减去两个日期并获得结果的分钟数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  Include missing months in Group By query(在 Group By 查询中包含缺失的月份)
                  Why Mysql#39;s Group By and Oracle#39;s Group by behaviours are different(为什么 Mysql 的 Group By 和 Oracle 的 Group by 行为不同)
                  MySQL GROUP BY DateTime +/- 3 seconds(MySQL GROUP BY DateTime +/- 3 秒)
                  MySQL cumulative sum grouped by date(按日期分组的 MySQL 累计总和)
                  Creating a flattened table/view of a hierarchically-defined set of data(创建分层定义的数据集的扁平表/视图)
                  MySQL: how to do row-level security (like Oracle#39;s Virtual Private Database)?(MySQL:如何做到行级安全(如 Oracle 的 Virtual Private Database)?)
                  <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>