sql [message #372687] |
Sat, 03 March 2001 03:55 |
Ra
Messages: 5 Registered: March 2001
|
Junior Member |
|
|
how to get top ten persons salary from table
|
|
|
Re: sql [message #372693 is a reply to message #372687] |
Sat, 03 March 2001 06:50 |
Balamurugan.R
Messages: 91 Registered: March 2001
|
Member |
|
|
Hai,
try this query
select distinct(sal) from emp x where 10>=
(select count(distinct(sal)) from emp x.sal<=sal);
|
|
|
Re: sql [message #372695 is a reply to message #372687] |
Sat, 03 March 2001 06:59 |
Balamurugan.R
Messages: 91 Registered: March 2001
|
Member |
|
|
hi,
sorry one mistake in the previous query
select distinct(sal) from emp x where 10>=
(select count(distinct(sal)) from emp where
x.sal<=sal) order by sal desc;
|
|
|