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
What is whitespace in html?
Explain type casting and type juggling.
How can we check the value of a given variable is alphanumeric?
Difference between mysql_connect and mysql_pconnect?
What is the function of mysql_real_escape_string in php?
Tell me will a comparison of an integer 12 and a string "13" work in php?
What is serialization in php?
How to create database connection and query in php?
What is the difference between file_get_contents() and file_put_contents() in php?
What are the different types of PHP arrays?
What is memcache?
How to execute an sql query?
Why json is used in php?
What is use of mysqli_query in php?
How do you remove duplicates from an array?