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

from the table display the 2nd highest salary?
and also the least 2nd salay?

Answer Posted / bobby

select p.emp_id,p.name,p.salary from
(select emp_id,name,salary,dense_rank()over( order by
salary desc)maxrank,
dense_rank()over( order by salary asc)minrank from test)p
where maxrank=2 or minrank=2

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 nolock?

988


What is snapshot parameter in ssrs?

151


List some advantages and disadvantages of stored procedure?

1017


Why do we use sql limitations? Which constraints can we use while making a database in sql?

1082


How do you clear a log file?

1054


What is index, cluster index and nonclustered index?

997


What will be the maximum number of indexes per table?

964


How can we delete a table in sql server?

980


what types of replication are supported in sql server? : Sql server database administration

1050


Why do we use trigger?

976


Where are stored procedures in sql server?

1069


What are the different types of locks in the database?

925


can we have a nested transaction? : Sql server database administration

1103


How do you delete a trigger?

987


What security features are available for stored procedure?

1038