How to retrieve the previous day of a specified date in DB2?

In DB2, you can use the following query to retrieve the previous day from a specified date:

SELECT DATE('指定日期') - 1 DAY

Replace the specified date with the date you want to retrieve the previous day. For example, if you want to retrieve the date of the day before January 1, 2022, you can query like this:

SELECT DATE('2022-01-01') - 1 DAY

This will be returned on December 31, 2021.

bannerAds