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
is mysql query is case sensitive? : Sql dba
What is pivot in sql?
What do you understand by pl/sql packages?
Why do we use function in pl sql?
What are conditional predicates?
what is sp_pkeys? : Transact sql
Can we use having without group by in sql?
What will you get by the cursor attribute sql%rowcount?
What is clustered index in sql?
How do I run a script in sql developer?
How to return an array from java to pl/sql?
Can delete statement be rollbacked?
Are there any features that are decommissioned in 11g that are not present in 11g?
When is the explicit cursor used ?
what is try_catch block in procedure