how to find the second highest salary from emp table?

Answer Posted / gurvinder

select max(sal)from emp where sal in(select sal from emp minus select max(sal) from emp);

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does over partition by mean in sql?

535


What is normalization in sql?

529


What is the difference between sql, mysql and sql server?

533


What are the events on which a database trigger can be based?

598


How can get second highest salary in sql?

509






How would you convert date into julian date format?

594


Does user triggers have entry for trigger with compilation errors?

602


What is difference between group by and partition by?

499


What is the example of procedure?

525


How to avoid using cursors? What to use instead of cursor and in what cases to do so?

608


What does inner join mean?

558


What is embedded sql with example?

546


how is myisam table stored? : Sql dba

607


What is synonyms?

573


how to create a test table in your mysql server? : Sql dba

500