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 many triggers can be applied on a table?
What does pragma mean?
Which are the different types of indexes in sql?
What are the operators in sql?
What is composite data type in pl sql?
how to fetch common records from two tables? : Sql dba
How do I save a sql query?
What are some predefined exceptions in pl/sql?
What is lexical units in pl sql?
Which software is used for pl sql programming?
What is implicit cursor in pl sql?
What is the use of partition by in sql?
What is sql partition?
What is relationship? How many types of relationship are there?
what is data integrity? : Sql dba