how to find the second highest salary from emp table?

Answer Posted / radha sri seshu

second method is
select sal from emp e1 where 2=(select count(distinct(sal))
from emp e2 where e1.sal<=e2.sal);

Is This Answer Correct ?    35 Yes 22 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is 'mysqlimport'? : Sql dba

565


what does it mean to have quoted_identifier on? What are the implications of having it off? : Sql dba

515


What is sorting in sql?

495


How do I run a script in sql developer?

483


How to change the order of columns in Oracle SQL Plus ?

604






ERROR:Insert or update on table"accnt" violates foreign key constraints "acct_to_curr_symbol" DETAILS:KEY(accnt_curr_id)(-2)is not present in the table "curr_symbol" ......solve The Problem..

1996


How can we implement rollback or commit statement in a trigger?

567


How many types of functions are there in sql?

488


how can we know the count/number of elements of an array? : Sql dba

564


What is ttitle and btitle?

567


What are expressions?

551


Explain the difference between sql and mysql.

550


what are the authentication modes in sql server? : Sql dba

516


what is a stored procedure? : Sql dba

539


What is sequence in sql?

497