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

Can we call procedure in select statement?

1041


Which sql most popular?

978


How does cross join work?

923


What is dense_rank in sql?

958


What is t sql used for?

1006


How do you add a column to a table?

1041


How do I view tables in mysql?

960


What is cursor in pl sql?

1101


What is the difference between a subquery and a join?

1079


Is grant a ddl statement?

890


What is the difference between explicit and implicit cursors in oracle?

1050


Show code of a cursor for loop.

1046


how does a local variable is defined using t-sql? : Transact sql

987


What are the string functions in sql?

962


How can we find duplicate records in a table?

929