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...

Write a query to get 2nd maximum salary in an employee table ?

Answer Posted / sohail

select empno,ename,sal
from (select ename,empno,sal,dense_rank()
over(order by sal desc)topn
from emp)
where topn=2

Is This Answer Correct ?    69 Yes 46 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how can we transpose a table using sql (changing rows to column or vice-versa) ? : Sql dba

947


How exception is different from error?

1014


What is partition in sql query?

998


Can we use ddl commands in pl sql?

1156


How to read xml file in oracle pl sql?

909


explain primary keys and auto increment fields in mysql : sql dba

972


How to avoid using cursors?

1117


Can 2 queries be executed simultaneously in a distributed database system?

1140


What is multiple partition?

962


What do we need to check in database testing?

1016


Difference between global and parameter variables?

1963


What is database migration?

963


What are views in sql?

976


Is primary key is clustered index?

996


what are myisam tables? : Sql dba

1030