-
EMPNO SALARY
1 100
2 200
3 300
4 400
5 500
6 500
7 700
With rownum you get 500 once, and you don't know which empno.
-
OK, but the original question doesn't mention empno at all ...
-
Hi
This will also work
select distinct a.sal from emp a
where 5>=(select count(distinct sal) from emp b where b.sal >=a.sal)
order by a.sal desc
just in place of 5 put what u want the top n salaries
cheers
sarath d
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|