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 |
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?
What are the differences between mysqli_connect and mysqli_pconnect?
Write a statement to show the joining of multiple comparisons in php?
To find out the current year is leap year or not which date() function we've to use.Give the syntax also
What is phpsessid?
How can we register the variables into a Session?
7 Answers HCL, Star Computers, Trikon Networks,
Explain Constant in Class?
Explain about Functions in PHP?
What is the difference between == and === operator in PHP?
Do you know when sessions ends?
can anyone explain oops concept in php or give website to learn this concept clearly?
Is php easier than node?