find highest salary
Answers were Sorted based on User's Feedback
Answer / subashvns
SELECT DISTINCT (
s1.salary
)
FROM `salary` s1
WHERE n -1 = (
SELECT count( DISTINCT (
s2.salary
) )
FROM `salary` s2
WHERE s2.salary > s1.salary )
| Is This Answer Correct ? | 4 Yes | 3 No |
Answer / renji
SELECT DISTINCT (
s1.salary
)
FROM `salary` s1
WHERE n -1 = (
SELECT count( DISTINCT (
s2.salary
) )
FROM `salary` s2
WHERE s2.salary > s1.salary )
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / qadeer
SELECT DISTINCT (
s1.salary
)
FROM `salary` s1
WHERE n -1 = (
SELECT count( DISTINCT (
s2.salary
) )
FROM `salary` s2
WHERE s2.salary > s1.salary )
| Is This Answer Correct ? | 2 Yes | 2 No |
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 |
Answer / richa
$P = shell_exec("SELECT salary
FROM mytable
ORDER BY
salary DESC");
echo $p[0];
| Is This Answer Correct ? | 0 Yes | 2 No |
How to get the total number of values in an array?
Which is the best institute in Chennai to learn PHP? Please help.
How to send email using php script?
Under what circumstance is it impossible to assign a default value to a parameter while declaring a function?
What is new static in php?
What is the difference between abstract class and interface in php?
I just installed php 5.3.1 in my linux server and now my old work which i used to write with tags is not working at all.. Please help me out.. How can i resolve this??
what will do ceil() and floor() in PHP?
How can you parse files that were not ending with .php by using Apache?
find highest salary
How many columns can be added in a table in mysql?
What exactly is validating and sanitizing?