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 |
iam mca post graduate in 2010 not getting job in JAVA so iam looking for carear in php as market demand is high so it is best option to try for php or not
What is meant by content management system?
3 Answers Global Logic, IBEE, TCS, Toyota,
How can you access a COM object from a PHP page?
What is the use session in php?
What is orm in php framework?
What is the name of scripting engine in php?
What does a dependant variable mean?
Which php framework is best for web development?
Name the Functions in IMAP, POP3 AND LDAP?
How do you check is php not empty?
Why ide is recommended for use while programming with php?
What is cookie and why do we use it?