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 |
i was set new individual folder for saving session values,the folder name is session and i set 777 permission,using session.save_path function like session.save_path "/home21b/sub004/sc21311-ULCX/candyoflove.com/session/" but it causing Warning: Unknown(): SAFE MODE Restriction in effect. The script whose uid/gid is 12112/12112 is not allowed to access /home21b/sub004/sc21311-ULCX/candyoflove.com/session owned by uid/gid 12267/12267 in Unknown on line 0 ,please tell what changes make this script, i was using .htaccesss file..plz help me....
What is meant by pdo in php?
What does nan stand for computer science?
What is php and what does it do?
What is the use of isset() in php?
What are magic methods?
When to use inquire vs enquire?
how to retrieve from database..... this format (PRMRMDU402). firstname= prabhu, lastname=kumar, city=madurai, pincode=624402.... i want first name first two letters and last name last two letters ... city first two letters ... pin code last three letters....
How to check if a string contains a character or word in php?
How to convert one date format into another in php?
Explain the three different kinds of Arrays?
how to include external php file in to html page?