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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the steps involved to run php?

1069


How we get browser details of clients machine?

1047


What is advanced php programming?

1029


What is php and its uses?

970


What is the difference between myisam and innodb?

1045


Does php need html?

985


What are the differences between mysqli_connect and mysqli_pconnect?

1004


Where is session value stored php?

1028


How can we pass the variable through the navigation between the pages?

992


What is the function of trim?

931


Explain how we can retrieve the data in the result set of mysql using php?

981


How do you end php?

981


What is the difference between single quoted string and double quoted string?

1097


Difference between mysql_connect and mysql_pconnect?

965


where do we use htaccess?

997