how to find the second highest salary from emp table?

Answer Posted / barochia dharmesh

select Income from (
select Rank() over(order by Income desc) topRecord, Income
from (select distinct Income from tblName) tbl ) tbl2
where topRecord = 2

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do we use procedures?

529


Is sql injection illegal?

608


Are ddl triggers fired for ddl statements within a pl/sql code executed using the dbms.sql package?

633


What is sql entity?

538


Which sql statement is used to delete data from a database?

480






Define concurrency control. : Transact sql

593


What are the usages of sql?

572


How does one load ebcdic data? : aql loader

663


What is the difference between a procedure and a function?

507


What is self-join and what is the requirement of self-join?

646


what are wild cards used in database for pattern matching ? : Sql dba

561


What is an exception in PL/SQL? What are the two types of exceptions?

635


what is the functionality of the function htmlentities? : Sql dba

530


The in operator may be used if you know the exact value you want to return for at least one of the columns.

566


What is difference between inner join and cross join?

530