how to get second highest salary in SQL(as/4000
Answer Posted / karunakarreddy.boyapally
SELECT DISTINCT A.SAL FROM EMP A
WHERE &N=(SELECT COUNT(DISTINCT(B.SAL)) FROM EMP B
WHERE A.SAL<B.SAL)
IF SUPPOSE IF U WANT 1 HIGEST SALARY GIVE N=1
IF SUPPOSE IF U WANT 2 HIGEST SALARY GIVE N=2
IF SUPPOSE IF U WANT 3 HIGEST SALARY GIVE N=3
| Is This Answer Correct ? | 10 Yes | 1 No |
Post New Answer View All Answers
How to assign sql query results to pl sql variables?
How do I send sql query results to excel?
how to convert dates to character strings? : Sql dba
How many sql core licenses do I need?
what is the difference difference between procedure and packages
what is the use of friend function? : Sql dba
Does normalization improve performance?
Can primary key be changed?
what is union, minus and interact commands? : Sql dba
what is query cache in mysql? : Sql dba
Can dml statements be used in pl/sql?
What are records give examples?
How do I make my sql query run faster?
How do you delete duplicates in sql query using rowid?
What is the difference between join and natural join?