how to find the second highest salary from emp table?

Answer Posted / kiran

select max(sal) from emp where sal in(select sal from emp
where sal<>(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

How can we optimize a sql query?

580


What is online transaction processing (oltp)?

605


What is oracle pl sql developer?

534


Is subquery faster than join?

573


What is the function that is used to transfer a pl/sql table log to a database table?

557






What is t-sql? : Transact sql

545


Which is better stored procedure or query?

551


What is set serveroutput on?

649


What is prepared statement in sql?

554


What is normalization in a database?

616


what is an execution plan? When would you use it? How would you view the execution plan? : Sql dba

554


what are date and time data types in mysql? : Sql dba

504


What are the basic sql commands?

552


how to use myisamchk to check or repair myisam tables? : Sql dba

512


How to fetch values from testtable1 that are not in testtable2 without using not keyword?

759