how to find the second highest salary from emp table?

Answer Posted / jayshree

select max(sal) from table_name where sal not in (select
max(sal) from table_name)

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how would you write a query to select all teams that won either 2, 4, 6 or 8 games? : Sql dba

775


What view means?

558


Is primary key always clustered index?

540


What are the conditions an underlying table must satisfy before a cursor can be used by a positioned update or delete statement? : Transact sql

540


What is multiple partition?

540






Why select is used in sql?

521


what is a table called, if it has neither cluster nor non-cluster index? What is it used for? : Sql dba

524


Do foreign keys improve performance?

549


How can you maintain the integrity of your database on instances where deleting an element in a table result in the deletion of the element(s) within another table?

667


Why do we use triggers?

522


What is the difference among union, minus and intersect?

546


Can we write ddl statements in functions?

569


What is time based sql injection?

490


Is primary key an index?

537


how can I make a script that can be bi-language (supports english, german)? : Sql dba

538