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 pl sql code?
what is the command used to fetch first 5 characters of the string? : Sql dba
What are data types in pl sql?
Can you call pl/sql package functions from within a fast formula?
How do you update a table in sql?
what is a database? : Sql dba
what is a trigger in mysql? Define different types of trigger. : Sql dba
What is tuple in sql?
What are the possible values for the boolean data field?
What are the two parts of design view?
How do I run a program in pl sql?
Can we create a trigger on view?
What are database links used for?
Does truncate remove indexes?
explain the difference between bool, tinyint and bit. : Sql dba