Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


how to find the second highest salary from emp table?

Answers were Sorted based on User's Feedback



how to find the second highest salary from emp table?..

Answer / krishna kishore

select top 1 salary from emp where salary in
(select top 2 salary from emp order by salary desc)
order by salary

Is This Answer Correct ?    1 Yes 0 No

how to find the second highest salary from emp table?..

Answer / 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

how to find the second highest salary from emp table?..

Answer / ramcharan tej

select max(emp-sal) from emp
where emp-sal <(select max(emp-sal) from emp).

Is This Answer Correct ?    1 Yes 0 No

how to find the second highest salary from emp table?..

Answer / anurag kumar rai

select max(sal) from employee where sal<(select max(sal) from employee)

Is This Answer Correct ?    1 Yes 0 No

how to find the second highest salary from emp table?..

Answer / sachin verma

select sal from emp
where rownum=2
order sal by Desc

Is This Answer Correct ?    1 Yes 0 No

how to find the second highest salary from emp table?..

Answer / anil maurya

select top 1 rate from HumanResources.EmployeePayHistory
where rate<(select MAX(rate) as R from HumanResources.EmployeePayHistory)
order by rAte Desc

Is This Answer Correct ?    1 Yes 0 No

how to find the second highest salary from emp table?..

Answer / surendra sharma

select min(sal) from table_name where sal in

(SELECT top 2 sal FROM table_name order by sal desc)

Is This Answer Correct ?    1 Yes 0 No

how to find the second highest salary from emp table?..

Answer / yash goyal

Select Distinct salary
from employees e
where &no-1=(select count(distinct salary )
from employees
where E.salary < salary);

Is This Answer Correct ?    1 Yes 0 No

how to find the second highest salary from emp table?..

Answer / bharat g

select * from (select ename,sal,dense_rank() over (order by sal desc) ranking from emp) where ranking=2;

Is This Answer Correct ?    1 Yes 0 No

how to find the second highest salary from emp table?..

Answer / vinay

select max(sal) from emp where rownum = 2;

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More SQL PLSQL Interview Questions

How will you debug your procedure? If your procedure is around 2000 lines and the expected output is 10 and we get only output 5.So how will you debug it? Somebody pls give the correct answer?

2 Answers   Fidelity,


What are the advantages of the packages

6 Answers   Oracle,


Does inner join return duplicate rows?

0 Answers  


What is auto increment?

0 Answers  


can we write stored function in out parameters? how to call through select statement? how to written more than one value plz give the exmple?

1 Answers  


What are the different parts of a package?

0 Answers  


Can we declare a column having number data type and its scale is larger than pricesionex: column_name number(10,100),column_name numbaer(10,-84)

0 Answers  


I need a exceptoin in pl/sql block so that if any errors occur in the block then no exception should errors should raise?

1 Answers  


types of exceptions and what is meant by pragma autonomous_transaction ?what is the use.

4 Answers   3i Infotech,


What is pl sql architecture?

0 Answers  


Is it possible to pass parameters to triggers?

0 Answers  


Can we use rowid as primary key?

0 Answers  


Categories