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
Can we use session in mvc?
Tell me what is the use of isset() in php?
Explain me difference between mysql_connect and mysql_pconnect?
What is stdclass in php?
"mysql_fetch_row — Get a result row as an enumerated array",this sentence comes from the PHP offical manual.However ,i can not understand the words "enumerated array".I need some help.Thanks a lot to everyone that reply.
Which is better php or nodejs?
Name and explain five of the PHP error constants?
What is the use of offset in mysql?
What is namespaces in PHP?
How many keywords are there in php?
What is api used for?
What is the most convenient hashing method to be used to hash passwords?
Why php is also called as scripting language?
A process can run only in the background. State Whether True or False?
How to redirect https to http url and vice versa in .htaccess?