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 the maximum number of columns in sql table?
What is the most common sql injection tool?
What is the difference between stored procedure and view?
what is bdb (berkeleydb)? : Sql dba
Can we join 3 tables in sql?
What are the advantages of pl sql over sql?
Explain the working of primary key?
what is index? : Sql dba
What do you mean by dbms? What are its different types?
In a distributed database system, can we execute two queries simultaneously?
how to shutdown mysql server? : Sql dba
What is sqlerrd?
Is nosql relational?
Why do we need a foreign key?
What does := mean in pl sql?