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 csrf mvc?
What is the use of preg_match in php?
What is singleton pattern in php?
What the difference between the 'bitwise and' operator and the 'logical and' operator?
What are the benefits of composer?
How we load all classes that placed in different directory in one php file , means how to do auto load classes.
What is the method to register a variable into a session?
What is the function mysql_pconnect() useful for?
Is PHP an open source software?
What is the difference between implode() and explode() in php?
Suppose we receive a form submitted by a post to subscribe to a newsletter. This form has only one field, an input text field named email. How would we validate whether the field is empty? Print a message "the email cannot be empty" in this case?
Is php easier than javascript?
What is a lambda function in php?
What is restful api?
Does php 7 support mysql?