DATEDIFF équivalent en Oracle

Solved
Hello,
does anyone have a function in Oracle that is equivalent to DATEDIFF from SqlServer?
Unless I am mistaken, it does not exist in Oracle.
I would like to know the difference that can exist between two dates, whether in months, days, hours, or minutes, ...

Thank you in advance

Configuration: Windows XP / Firefox 3.5.5

1 answer

  1. On Oracle, you just need to perform an arithmetic operation

    select DATE1-DATE2 from dual

    1 = 1 day, the digits after the decimal represent fractions of days.

    Use trunc() to get the number of days

    Otherwise, multiply the decimal value
    by 24 for hours
    by 1440 for minutes
    by 86400 for seconds
    8
    1. Thank you! I'm stunned that it doesn't exist natively in Oracle, I will create the function.
      0
    2. well, the oracle function is more logical than the datediff function, but it's a matter of perspective ^^
      0
    3. Thanks ;D
      0