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
What is a sql*loader control file?
What are the different types of a subquery?
Why sql query is slow?
How do I view tables in mysql?
what is a cursor? : Sql dba
What is varchar example?
What is offset and limit in sql?
what are the different functions in sorting an array? : Sql dba
What is pivot query?
Define tables and fields in a database
how can we destroy the session, how can we unset the variable of a session? : Sql dba
What are crud methods?
How do I truncate a word?
How to Declare Fixed Length String Value In PL SQL
Is the primary key an index?