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...


find out the second highest salary?

Answers were Sorted based on User's Feedback



find out the second highest salary?..

Answer / nusrath sultana

select * from emp
where &n=(select count(distinct(sal)) from emp b
where emp.sal<=b.sal)

Is This Answer Correct ?    1 Yes 1 No

find out the second highest salary?..

Answer / hari kanth

select sal from(select sal,rank() over(order by sal desc)
rnk from emp) e
where e.rnk=2;
(OR)
select rownum,sal from emp group by sal,rownum
having rownum=2;
(OR)
select rn,sal from( select rownum rn,sal from emp group by
sal,rownum order by sal desc)
where rn=2;

Is This Answer Correct ?    3 Yes 3 No

find out the second highest salary?..

Answer / aravind

select * from empdetails where sal=(select max(sal) from
empdetails where sal<(select max(sal)from empdetails));

Is This Answer Correct ?    0 Yes 0 No

find out the second highest salary?..

Answer / anand

SELECT SALARY FROM (SELECT SALARY FROM emp WHERE ROWNUM < 3
ORDER
BY salary) WHERE ROWNUM < 2

Is This Answer Correct ?    0 Yes 0 No

find out the second highest salary?..

Answer / sikindar

SELECT DISTINCT (a.sal) FROM EMP A WHERE &N = (SELECT COUNT (DISTINCT (b.sal)) FROM EMP B WHERE a.sal<=b.sal)

Is This Answer Correct ?    0 Yes 0 No

find out the second highest salary?..

Answer / amulya kumar panda

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

Is This Answer Correct ?    0 Yes 0 No

find out the second highest salary?..

Answer / raunaq

to all the people who are using rownum in their queries...

This query will not work if you have more than 1 person
having the second highest salary

Is This Answer Correct ?    0 Yes 0 No

find out the second highest salary?..

Answer / akash

select emp_id,sal from ( select emp_id,sal from emp where
sal < ( select max(sal) from emp) order by sal desc ) where
rownum < 2;

Is This Answer Correct ?    0 Yes 0 No

find out the second highest salary?..

Answer / nagaraju

SELECT LEVEL,MAX(SAL)
FROM EMP
WHERE LEVEL IN(2,3)
CONNECT BY PRIOR SAL>SAL
GROUP BY LEVEL;

Is This Answer Correct ?    0 Yes 0 No

find out the second highest salary?..

Answer / madan kumar

select *from (select empno,deptno,min(sal) from emp
group by empno,deptno,sal
order by sal desc)
where rownum<=1

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Oracle General Interview Questions

I'm doing my final year and i ve planned to do an oracle certification , is this the rit tim nd wat's the future scope??

1 Answers  


What is a directory object?

0 Answers  


a query to select maxmun 3 salaries of employee table

12 Answers   IBM, Polaris,


What is DTS and purpose of DTS ?

1 Answers   TCS,


Assuming that you are an End User How to find that in the payment Batch some of the Invoice was  Missing To pay How to find That??

0 Answers  


What are operators in oracle?

0 Answers  


what is candidate key & super key

1 Answers  


What is proxy method?

0 Answers  


what is integrity constrains?

3 Answers  


What is a deadlock ? Explain .

1 Answers  


What are the original export and import utilities?

0 Answers  


acname actype amount ac1 credit 300 ac2 credit 4000 ac1 debit 4000 ac2 debit 455 ac1 credit 500 how to get sum of credit and sum of debit for each account

2 Answers   Polaris,


Categories
  • Oracle General Interview Questions Oracle General (1809)
  • Oracle DBA (Database Administration) Interview Questions Oracle DBA (Database Administration) (261)
  • Oracle Call Interface (OCI) Interview Questions Oracle Call Interface (OCI) (10)
  • Oracle Architecture Interview Questions Oracle Architecture (90)
  • Oracle Security Interview Questions Oracle Security (38)
  • Oracle Forms Reports Interview Questions Oracle Forms Reports (510)
  • Oracle Data Integrator (ODI) Interview Questions Oracle Data Integrator (ODI) (120)
  • Oracle ETL Interview Questions Oracle ETL (15)
  • Oracle RAC Interview Questions Oracle RAC (93)
  • Oracle D2K Interview Questions Oracle D2K (72)
  • Oracle AllOther Interview Questions Oracle AllOther (241)