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

SQL> desc emp_test;

Name
-----
EMP_NO SAL
DEP_NO

SQL> select * from emp_test;

1001 10000 11
1001 10000 11
1002 100 11
1003 20010 11
1004 99 11
1005 50 11
1006 25 11

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;

1002 100 11

1 row selected.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the query to display top 20 rows?

1023


What is the difference between primary key and candidate key?

1023


How to get nth highest salary from table in a mysql?

958


How many rows can a mysql table hold?

1022


Write a query to create a database and a table?

911


Is mysql a good database?

954


How can you handle the –secure-file-priv in mysql?

948


What language does mysql use?

915


Can a table have multiple primary keys?

908


How do I stop a query in mysql workbench?

946


Is mysql good for large database?

937


What do ddl, dml, and dcl stand for?

920


Is mysql easy to learn?

950


What does schema mean?

953


Is mongodb faster than mysql?

956