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 length of a table name, database name, and fieldname in mysql? : Sql dba
What are inbuilt functions in sql?
What are the possible values for the boolean data field?
Explain the difference between cursor declared in procedures and cursors declared in the package specification?
What is the maximum rows in csv?
How do I turn a list into a table?
how to create a new table in mysql? : Sql dba
What is pl sql package?
Do we need to create index on primary key?
how do you know the version of your mysql server? : Sql dba
How we can create a table in pl/sql block. Insert records into it? Is it possible by some procedure or function? Please give example?
How do you drop a trigger?
What are basic techniques of indexing?
What is a heap in sql?
What is trigger types in sql?