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 / abhishek jaiswal

select salary from employees a where &nth_highest_salary =(select count(distinct salary)
from employees b where a.salary<=b.salary)
/

Is This Answer Correct ?    1 Yes 0 No

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

Answer / mohammed irfan

SELECT sal1 "salary"
FROM (SELECT ROWNUM rownum1 ,sal1
FROM (SELECT sal sal1
FROM emp
ORDER BY sal DESC
)
)
WHERE rownum1=:p_highest;

Note:- 'p_highest' here we can give the number as we want
to display the highest salary.

Is This Answer Correct ?    1 Yes 1 No

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

Answer / ruma

select *from emp order by sal desc limit 1,1

Is This Answer Correct ?    5 Yes 5 No

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

Answer / hitesh pundir

select max(salary)from m1 where salary <>(select max(salary)
from m1)

Is This Answer Correct ?    2 Yes 2 No

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

Answer / vinay

It works gr8...

select max(salary) from <table_name> where salary<(select
max(salary)from <table_name>)

Is This Answer Correct ?    2 Yes 2 No

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

Answer / mallika

SELECT salary FROM employee a
WHERE &n IN (SELECT COUNT(*) FROM employee b
WHERE a.salary <= b.salary)

Is This Answer Correct ?    2 Yes 2 No

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

Answer / neeraj

SELECT DISTINCT(SAL) FROM EMP
WHERE SAL=(SELECT MIN(SAL) FROM (SELECT SAL FROM EMP ORDER
BY SAL DESC)
WHERE ROWNUM<=2);

Is This Answer Correct ?    2 Yes 2 No

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

Answer / sathiavathi

select max(salary) from employee where salary!=(select max
(salary) from employee);

Is This Answer Correct ?    1 Yes 1 No

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

Answer / sarojkant

select max(salary ) from emp table where sal<(select max
(salary)from emp table)

Is This Answer Correct ?    0 Yes 0 No

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

Answer / sarojkant

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

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL PLSQL Interview Questions

What is a full join?

0 Answers  


What is cte sql?

0 Answers  


What is sql performance tuning?

0 Answers  


What is the difference between left outer join and left join?

0 Answers  


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

0 Answers  


How do I add a primary key to a table?

0 Answers  


Does a primary key have to be a number?

0 Answers  


How to improve the performance of a pl/sq stored procedures or functions or triggers and packages ?

12 Answers   IBM, TCS, UHD,


Why commit is not used in triggers?

0 Answers  


1. is it possible to use the cursor atttibutes (%found ,% rowcount , %isopen , %notfound ) to our user defined cursor names ....... cursor cursor_name is select * from scott.emp if you use... cursor_name%found , %rowcount ,%isopen,%notfound...will it work... -------------------------- 2.what is the difference between the varray and index by table .. -------- 3. type type_name is table of number(8,3) index by binary_integer; identifier_name type_name; first , last , prior , next ,trim are the methods we can use it for the above type...simillary is there any way to apply for cursors... with thanks and regards..sarao...

0 Answers   Satyam,


Can sql developer connect to db2?

0 Answers  


what is inline view?

15 Answers  


Categories