Write a query to get 2nd maximum salary in an employee table ?

Answer Posted / hasnain hameed

select max(salary)
from emp
where salary < (select max(salary) from emp)
order by salary desc;





i think this is correct answer all of above because it take
less time to execute. retrive the answer quickly.

Is This Answer Correct ?    6 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Determine if oracle date is on a weekend?

558


List the ways to get the count of records in a table?

512


What does over partition by mean in sql?

538


what are ddl statements in mysql? : Sql dba

579


1) Synonyms 2) Co-related Subquery 3) Different Jobs in Plsql 4) Explain Plan 5) Wrap 6) Query Optimization Technique 7) Bulk Collect 8) Types of index 9) IF primary key is created then the index created ? 10) Foreign Key 11) Exception Handling 12) Difference Between Delete and Trunc 13) Procedure Overloading 14) Grant Revoke 15) Procedure Argument types. 16) Functions. 17) Joins

1160






What is %type in sql?

522


What is ttitle and btitle?

579


Is sql procedural language?

556


Does view store data in sql?

540


What is the maximum database size for sql express?

540


How many types of triggers exist in pl/sql?

574


How can you select unique records from a table?

524


What is normalization in a database?

614


how to delete an existing column in a table? : Sql dba

556


What is structural independence and why is it important?

551