+ -
当前位置:首页 → 问答吧 → oracle

oracle

时间:2011-11-07

来源:互联网

1:请问oracle 怎么删除重复记录
2:假设员工表中有一字段,薪资,现在要查出这表的所有信息,然后按薪资从高到底排列,前三行显示薪资排名前三的信息,其余的按原来的顺序排列。请举例说明,谢谢。oracle 数据库我不是很熟悉。

作者: gaofeng2009123   发布时间: 2011-11-07

select * from employee where rownum <= 3 order by salary desc
union select * from employee t where not exist (select employee_id from employee t2 where t1.employee_id = t2.employee_id and rownum <= 3);

作者: hanpoyangtitan   发布时间: 2011-11-08

热门下载

更多