how to calcuate the second highest salary of he employee

Answer Posted / shailesh

select sal from emp where sal=(select max(sal) from emp
where sal<(select max(sal) from emp);

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

explain the difference between bool, tinyint and bit. : Sql dba

524


What is cost in sql execution plan?

490


How do I write a cron which will run a sql query and mail the results to agroup?

527


How to sort the rows in sql.

603


What can you do with pl sql?

563






How do you create a unique index?

573


what is subquery? : Sql dba

568


how to drop an existing view in mysql? : Sql dba

570


What is mutating trigger?

581


What is difference between ms sql and mysql?

476


What is compiled query?

518


Can we use rowid as primary key?

546


What is an emotional trigger?

518


Can function return multiple values in sql?

528


What is scalar function in sql?

531