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

What is user in mysql?

940


What is ntext?

1133


Explain the difference between primary key and candidate key in mysql?

1007


How to enter numeric values as hex numbers?

1028


How to get a version of mysql?

1098


What is mysql enterprise edition?

956


What is difference between mysql and mysql workbench?

1009


What causes mysql too many connections?

1025


How do I backup mysql database on linux?

965


What is the purpose of -> in the mysql terminal?

1172


How to escape special characters in sql statements?

1004


What is row level locking in mysql?

1064


What is mysql ndb?

939


How to delete a trigger in mysql?

975


What are date and time functions in mysql?

1058