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 second highest salary

Answers were Sorted based on User's Feedback



How to find second highest salary..

Answer / anuj

For Second Highest Salary:
select salary from tbl_name order by salary desc limit 1,1
For Third Highest Salary:
select salary from tbl_name order by salary desc limit 2,1
For Fourth Highest Salary:
select salary from tbl_name order by salary desc limit 3,1

Is This Answer Correct ?    13 Yes 4 No

How to find second highest salary..

Answer / shrikant patil

select max(salary) from tbl_name where salary !=(select
max(salary) from tbl_name);

Is This Answer Correct ?    9 Yes 2 No

How to find second highest salary..

Answer / devasundaram

SELECT salary FROM Employee_table ORDER BY salary DESC LIMIT 1,1

Is This Answer Correct ?    13 Yes 10 No

How to find second highest salary..

Answer / prakash.matte

if we want to make use of nested query instead of the above,
try the following

select max(column_name) from table_name where column_name =
(select
max(column_name)-(highest_salary_number_for_calculation -1)
from blocks where bid);

Example :

For second highest salary:

select max(bid) from blocks where bid = (select max(bid)-1
from blocks);

For third highest salary:

select max(bid) from blocks where bid = (select max(bid)-2
from blocks);

Is This Answer Correct ?    3 Yes 2 No

How to find second highest salary..

Answer / petercoloney

select salary from employee where max(salary)<(select salary from employee)

Is This Answer Correct ?    3 Yes 3 No

How to find second highest salary..

Answer / jose_100

SELECT SAL FROM SALARY_TABLE ORDER BY SAL DESC LIMIT 1,1;

Is This Answer Correct ?    1 Yes 1 No

How to find second highest salary..

Answer / vishnu

select salary from table where salary!=max(salary) order by
desc limit 1

Is This Answer Correct ?    0 Yes 0 No

How to find second highest salary..

Answer / nitish

SELECT sallary FROM employee ORDER BY sallary ASC limit 1,2

Is This Answer Correct ?    16 Yes 22 No

How to find second highest salary..

Answer / jaimin desai

Select MAX(Salary) from tbl
order by salary DESC limit 1,1

Is This Answer Correct ?    1 Yes 7 No

Post New Answer

More PHP Interview Questions

Php code to find whether a number armstrong or not?

0 Answers  


How to remove duplicate values from a PHP Array?

0 Answers  


how to run PHP in command line?

8 Answers   InfoShore, Ramp Green, Xtreeme,


Explain me how to include a file to a php page?

0 Answers  


what is magic code ?

4 Answers   eVenturers, iFlash, Zynga,


How many escape sequences are recognized in double-quoted strings in php?

0 Answers  


What do you mean by having php as whitespace insensitive?

0 Answers  


Whether session will work if we disable cookies in client browser ?

10 Answers  


Can you explain, when to use if-else if-else over switch statements?

0 Answers  


What is the purpose of the following files having extensions: frm, myd, and myi? What these files contain?

0 Answers  


In how many ways we can retrieve the date in the result set of mysql using PHP?

5 Answers   Yahoo,


What is the use of inner join in mysql?

0 Answers  


Categories