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 / prativa mishra

select *
from
(select salary,dense_rank() over (order by salary) kk from table_name)
where kk=2

Is This Answer Correct ?    7 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is rank function in sql?

1041


What is natural join in sql?

1007


what is an execution plan? When would you use it? How would you view the execution plan? : Sql dba

986


Why is nosql good?

1038


What will you get by the cursor attribute sql%notfound?

1091


Explain constraints in sql?

1055


How subquery works in sql?

1079


Explain the working of foreign key?

1078


What is primary key and foreign key with example?

944


What is function and procedure in pl sql?

1059


If a cursor is open, how can we find in a pl/sql block?

1175


What are procedures used for?

996


Does sql profiler affect performance?

1002


What is the difference between between and in condition operators?

1017


What is the difference between alter trigger and drop trigger statements?

1120