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 find the second highest salary from emp table?

Answer Posted / chitti

Hi Viewers here is the simple query to find the highest
salary:-

1)Highest five salaries:-

select top 5 salary from employee order by salary desc

2)Highest 5th salary:-

select top 1 salary from(select top 5 salary from
employee order by salary desc) temp1 order by salary asc

3)Highest 4th salary:-

select top 1 salary from (select top 4 salary from
employee order by salary desc) temp1 order by salary asc

4)Highest 3rd salary:-

select top 1 salary from (select top 3 salary from
employee order by salary desc) temp1 order by salary asc

5)Highest 2nd salary:-

select top 1 salary from(select top 2 salary from
employee order by salary desc) temp1 order by salary asc

6)Highest 1st salary or highest salary:-

select max(salary) from employee

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by field in sql?

1076


Is postgresql a server?

1046


Is join and inner join the same?

1001


What is the difference between delete, truncate and drop command?

1147


Explain character-manipulation functions?

1123


Explain the uses of database trigger.

1112


Difference between truncate, delete and drop commands?

1082


What do we need to check in database testing?

1017


How many clustered indexes can you have?

973


How do I trace sql profiler?

970


How many clustered indexes can be created on a table?

1074


What is dcl in sql?

957


How do I filter in sql profiler?

991


List and explain the different types of join clauses supported in ansi-standard sql?

1353


what is data manipulation language? : Sql dba

1012