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


How to retrieve a second highest salary from a table?
Note:Suppose salaries are in duplicate values
eg:
Name Sal
Malli 60000
Pandi 60000
Rudra 45000
Ravi 45000

Answer Posted / dewesh

With cte as (
Select *, Dense_rank() over (order by salary desc) as s from emp)
Select EmpName, Salary from cte where s =2
It has work. But duplicate value is not removed if name is different

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does truncate remove indexes?

1081


What is the difference between the conventional and direct path loads? : aql loader

1473


What is sql scripting?

1194


How to display the records between two range in Oracle SQL Plus?

1195


how to rename an existing column in a table? : Sql dba

1082


define sql update statement ? : Sql dba

1159


explain access control lists. : Sql dba

1050


What is dba in sql? : SQL DBA

1094


why does the selected column have to be in the group by clause or part of an aggregate function? : Sql dba

1164


What does an inner join do?

1248


How many types of keys are there in sql?

1086


How do I count records in sql?

1053


What is left inner join in sql?

1094


What is flag in sql?

1099


what is meant by nl2br()? : Sql dba

1107