SQL [message #371585] |
Thu, 09 November 2000 23:44 |
subhas
Messages: 1 Registered: November 2000
|
Junior Member |
|
|
A table salary is there.
it has only one field, sal number(5).
Pls tell the shortest
query to select the 2 highest salaries.
|
|
|
Re: SQL [message #371587 is a reply to message #371585] |
Fri, 10 November 2000 02:30 |
Dimitar
Messages: 2 Registered: November 2000
|
Junior Member |
|
|
!!! Improved version to eliminate null values
try this:
select sal
from ( select nvl(sal,0) from salary
order by sal desc
)
where rownum < 3;
|
|
|
Re: SQL [message #371588 is a reply to message #371585] |
Fri, 10 November 2000 02:34 |
Dimitar
Messages: 2 Registered: November 2000
|
Junior Member |
|
|
!!! Improved version to eliminate null values
try this:
select sal
from ( select nvl(sal,0) as sal from salary order by sal desc )
where rownum < 3;
|
|
|