select your_num from table_name where rownum <= 3 group by your_num
解决方案 »
- 关于表空间
- 在建RAC数据库时遇到的一个难题
- ORACLE 10G中 ISQL PLUS 中看不到系统表名,哪里找呀
- 一个itpub没人解决的问题
- PL/SQL 里面,右健点击存储过程,可以发现一个 recompile 命令,请问这个命令应该如何在语句中实现?
- 急.......数据库之间的转换!!!!!!!!!!!
- 新手问题,关于触发器,来者有分!
- 各位请问谁有关于ORACLE DBA入门的PPT文档的资料?
- 请教各位大侠ORACLE和PL/SQL事宜
- ORA-12638: Credential retrieval failed这是什么原因
- 函数的输出问题
- Win2K中的MSDAORA.1连接到oracle的驱动丢失,请问如何重新安装?
select distinct your_num from table_name order by your_num) where rownum <=3
(select col,row_number() over(order by col) rnum from tbname) t
where rnum<4;
id score
1 100
2 78
3 88
4 68
5 98
6 88
结果如下
1 100
5 98
3 88
6 88
SELECT col1,col2,col3,
row_number()
OVER (PARTITION BY ny
ORDER BY 成绩 desc NULLS LAST) top_3
FROM table) b
where b.top_3<=3;
SELECT col1,col2,col3,
row_number()
OVER (ORDER BY 成绩 desc NULLS LAST) top_3
FROM table) b
where b.top_3<=3;
(select col,rank() over(order by col) rnum from tbname) t
where rnum<4;
id score
1 100
2 78
3 88
4 68
5 98
6 88
结果如下
1 100
5 98
3 88
6 88
(select col,dense_rank() over(order by col) rnum from tbname) t
where rnum<4;