1:查询数据库表中日期降序排列后的第二大日期(昨天)
SELECT yestoday FROM (
SELECT ROWNUM RECNO, a.* FROM (
select distinct to_char(DATA_DATE,‘yyyy-mm-dd‘) yestoday from TBL_INT_DUAL
where count_time_type=‘2‘ order by to_char(DATA_DATE,‘yyyy-mm-dd‘) desc ) a
WHERE ROWNUM <= 5 ORDER BY ROWNUM ASC )
WHERE RECNO = 2
时间: 2024-10-29 19:10:42