tab1 表中数据如下 id val 1 10 2 11
3 14
请问如何查询val第二大的那条数据
是select id from tab1 where rownum=1 order by val desc 这样对么
3 14
请问如何查询val第二大的那条数据
是select id from tab1 where rownum=1 order by val desc 这样对么
解决方案 »
- 怎样在loop中让这个红色的主键不重复呢?
- 求解关于统计的SQL语句
- 急急急...怎么创建Oracle全文索引?着急请各位大侠帮忙!
- 求助:关于RMAN脚本的问题
- 提问一个有关oracle语句的写法
- oracle 10g 需要什么样的硬件配置?
- 急问,我把一台机子的Oracle客户端81升到92,升级会不会出现问题?
- 请教。。下载oracle 8.1.7 Enterprise Edition不知所云!
- 请问oracle9i中service名和SID的区别
- 请问一下用C++开发ORACLE需要那些库,那位兄弟有资料吗?
- 我想在这个存储过程的游标中加条件,根据输入的值进行判断,请大家帮我修改以下,总是报错
- pl/sql菜鸟求助
这个少了个东西,下面这个补充上了
select id from ( select rownum no,id ,val from tab1 where rownum <=2 order by val desc ) t where no=1 order by val
insert into tab1 values(1,10);
insert into tab1 values(2,11);
insert into tab1 values(3,14);select * from tab1 a
where id not in (select max(id) from tab1)
and exists(select 1 from tab1 where a.id>id)