Home Oracle add_month函数
Post
Cancel

Oracle add_month函数

1
2
3
4
5
6
7
8
9
10
SELECT
  ADD_MONTHS (
    TO_DATE (
      TO_CHAR (SYSDATE, 'yyyy-MM-dd'),
      'yyyy-MM-dd HH24:mi:ss'
    ),
    - 1
  )
FROM
  dual

执行结果为上一个月的今天。

This post is licensed under CC BY 4.0 by the author.