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

I Have Employee table having column name as ID,SALARY
how to get second max salary from employee table with id
ex
ID SALARY
1 20000
7 37000
2 5000

Answer Posted / lekhrajdeshmukh

select top 1 id,salary from(select top 2 id,salary from
employee group by id,salary order by salary desc)a order by
salary asc

Is This Answer Correct ?    5 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is dknf in normalization form?

1006


Is foreign key unique?

969


What specific conditions database should meet, before you can bulk copy data into it using bcp?

955


What are the new features in SQL Server 2005 when compared to SQL Server 2000?

1117


What is difference between drop truncate and delete?

1033


Is foreign key a primary key?

1013


What are a scheduled jobs or what is a scheduled tasks?

869


Explain the commands in sql server?

993


Can a rule be bound to any column of any data type?

933


what is the maximum size of a row? : Sql server database administration

972


How to transfer a table from one schema to another?

965


what is a self join? : Sql server database administration

985


How to use “drop” keyword in sql server and give an example?

1103


Explain logical operators in sql server?

1055


Difference between Logical Page and Physical Page in SSRS.

466