find highest salary

Answer Posted / ankur gupta

FOR Nth Highest Salary Where N= 1,2,3,4

SELECT * FROM EMP E1 WHERE N=(SELECT COUNT(DISTINCT SAL)
FROM EMP E2 WHERE E1.SAL <= E2.SAL)


I have tested This Query on MySQL 5.1.41. its working fine.

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I update php?

572


What does the unset() function mean?

562


What are form input html tags?

555


How to read a file in binary mode?

633


What is the meaning of a persistent cookie?

558






How can we change the value of a constant?

537


Explain me the difference between include and require?

513


How to find the length of a string?

544


How can I make a script that can be bilingual (supports english, german)?

584


Why php is also called as scripting language?

548


Explain the ternary conditional operator in php?

598


What are the methods to submit form in php?

525


What is the use of mysql_real_escape_string in php?

451


Tell me how to create a text file in php?

548


What are the differences between GET and POST methods in form submitting?

566