如果是精确查询,都一样大,没必要区分。如果是模糊查询,比如表test,关键子所在的字段在a列,可尝试下面的sql
select t.a
from (select a, rownum rn
from test
where a like '%关键字%'
--and rownum <= 2
order by a desc) t
where rn = 2
SELECT MAX(TO_NUMBER(col))
FROM TABLE
WHERE TO_NUMBER(col) <>
(SELECT MAX(TO_NUMBER(col)) FROM TABLE )
order by *** desc where rownum = 2
排序完了后加上条件rownum=2