Home » RDBMS Server » Server Administration » sql
sql [message #372687] Sat, 03 March 2001 03:55 Go to next message
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 Go to previous messageGo to next message
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 Go to previous message
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;
Previous Topic: Help
Next Topic: Index
Goto Forum:
  


Current Time: Thu Jun 13 21:34:25 CDT 2024