Answer Posted / saraswathi muthuraman
The previous post is to find the 3rd highest value.
Please find the below qry to find the top 3 highest salary
SQL> select a.EMP_NO,a.SAL,a.DEP_NO from emp_test a, (select
SAL,rank() over(order by sal desc) as rank_val from emp_test
group by sal)b where
2 a.sal=b.sal and b.rank_val <=3;
1003 20010 11
1001 10000 11
1001 10000 11
1002 100 11
4 rows selected.
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
What are the non-standard sql commands supported by 'mysql'?
Why MySQL is used?
What is a mysql server?
What is mysqladmin flush hosts?
How to create trigger in mysql workbench?
What are mysql functions?
How do I change global variables in mysql?
Is there a free mysql?
How do I select a table in mysql?
How to include character strings in sql statements?
Can you tell the difference between mysql_fetch_object and mysql_fetch_array?
How do I start and stop mysql on windows?
Explain the different types of mysql joins.
How do I clear the command in mysql?
What does mysql flush hosts do?