【发布时间】:2021-11-24 09:25:18
【问题描述】:
我有一个包含日期的数据表,我需要使用 PL/SQL 从中找到第二个最大日期
| Date |
|---|
| 02-OCT-2021 |
| 30-SEP-2021 |
| 29-SEP-2021 |
| 28-SEP-2021 |
我的查询是,
select MAX(status_date) from A where status_date not in (select MAX(status_date) from A)
29-SEP-2021 是查询结果,但应该是30-SEP-2021
【问题讨论】: