标签:
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
标签:
原文地址:http://www.cnblogs.com/lyfjy/p/4248483.html