Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Print 3 highest salary

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


Please Help Members By Posting Answers For Below Questions

How to return query output in xml format?

1038


How do I select a table in mysql?

941


What is datadir?

889


How do I optimize a selected query in mysql?

934


How do I start mysql in ubuntu?

1041


all the queries used in sql

2662


How much does mysql enterprise cost?

928


How do I change the max connection in mysql?

962


What is schema in mysql?

898


What is definer in mysql trigger?

918


Does mysql support sequence?

948


What is sql in mysql?

1036


How to Set a root password if there is on root password.

1093


What is index length in mysql?

946


What is the difference between a heap table and temporary table?

945