Oracle函数之间的时间间隔
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Oracle函数之间的时间间隔相关的知识,希望对你有一定的参考价值。
A few examples of the MONTHS_BETWEEN function.
--MONTHS_BETWEEN SELECT MONTHS_BETWEEN( TO_DATE('01/06/2015', 'dd/mm/yyyy'), TO_DATE('07/02/2015', 'dd/mm/yyyy')) AS MB_TEST FROM dual; SELECT MONTHS_BETWEEN( TO_DATE('14/03/2015', 'dd/mm/yyyy'), TO_DATE('20/09/2015', 'dd/mm/yyyy')) AS MB_TEST FROM dual; SELECT MONTHS_BETWEEN( TO_DATE('10/12/2004', 'dd/mm/yyyy'), TO_DATE('02/05/1981', 'dd/mm/yyyy')) AS MB_TEST FROM dual; SELECT MONTHS_BETWEEN( TO_DATE('04/08/2015', 'dd/mm/yyyy'), TO_DATE('04/04/2015', 'dd/mm/yyyy')) AS MB_TEST FROM dual; SELECT MONTHS_BETWEEN( TO_DATE('11/04/2015', 'dd/mm/yyyy'), TO_DATE('11/04/2015', 'dd/mm/yyyy')) AS MB_TEST FROM dual; SELECT MONTHS_BETWEEN( TO_DATE('31/01/2015', 'dd/mm/yyyy'), TO_DATE('30/04/2015', 'dd/mm/yyyy')) AS MB_TEST FROM dual;
以上是关于Oracle函数之间的时间间隔的主要内容,如果未能解决你的问题,请参考以下文章
oracle db 如何用一条sql查询2个时间之间的工作时间间隔