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 ms sql server reporting services?

995


Explain the difference between primary keys and foreign keys?

944


Can we take the full database backup in log shipping?

901


Explain different forms of normalization?

890


Where does the copy job runs in the log shipping primary or secondary? : sql server database administration

1001


Is there any performance difference between if exists (select null from table) and if exists (select 1 from table)?

905


How can windows applications connect to sql servers via odbc?

1062


How to include text values in sql statements?

985


How to create a local temporary stored procedure?

949


Is resultset an interface?

905


What is the difference between ddl,dml and dcl commands?

1060


Does union all remove duplicates?

1019


What is a partition key?

889


How can you control the amount of free space in your index pages?

1012


in a table is b in column k (manikanta,sivananda,muralidhar) i want result like (mnikanta,sivnanda,murlidhar) please slove it

1453