find out the second highest salary?

Answers were Sorted based on User's Feedback



find out the second highest salary?..

Answer / digvijay

select max(salary) from emp where salary < Top Salary

Is This Answer Correct ?    0 Yes 0 No

find out the second highest salary?..

Answer / prem

SQL> select salary from(select salary,rownum a from(select salary from employee order by salary desc))where a=2;

Is This Answer Correct ?    0 Yes 0 No

find out the second highest salary?..

Answer / souri sengupta

select max(salary) from employee where salary not in (select max(salary) from employee);


This worked :)

Is This Answer Correct ?    0 Yes 0 No

find out the second highest salary?..

Answer / sujeet sinha

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

Is This Answer Correct ?    1 Yes 1 No

find out the second highest salary?..

Answer / mukesh

Second highest Value

select max(user_id) from users
where user_id < (select max (user_id) from users)


Mukesh Narayan SIngh
09873595976
mukeshnsingh22@gmail.com

Is This Answer Correct ?    1 Yes 1 No

find out the second highest salary?..

Answer / mahendra

SELECT max(salary) FROM Employee WHERE salary NOT IN
(SELECT max(salary) FROM Employee);

Is This Answer Correct ?    1 Yes 1 No

find out the second highest salary?..

Answer / asit kumar sahu

SELECT DISTINCT SAL FROM EMP E1
WHERE 2=(SELECT COUNT(DISTINCT SAL) FROM EMP E2
WHERE E1.SAL <= E2.SAL);

OUTPUT= 3000

Is This Answer Correct ?    0 Yes 0 No

find out the second highest salary?..

Answer / new

select max(salary) from users where salary not in (select max(salary) from users)

Is This Answer Correct ?    0 Yes 0 No

find out the second highest salary?..

Answer / elumalai d

SELECT * FROM (SELECT salary FROM emp ORDER BY salary DESC) WHERE ROWNUM<3;

Is This Answer Correct ?    0 Yes 0 No

find out the second highest salary?..

Answer / elumalai d

CREATE TABLE emp(ID NUMBER(10),NAME VARCHAR2(100),salary NUMBER(10));

INSERT INTO emp VALUES(100,'Steven',40000);
INSERT INTO emp VALUES(101,'Smith',30000);
INSERT INTO emp VALUES(102,'Ranshow',70000);
INSERT INTO emp VALUES(103,'Handscomp',20000);
INSERT INTO emp VALUES(104,'Mitchel',10000);
INSERT INTO emp VALUES(105,'Clarke',90000);
INSERT INTO emp VALUES(106,'Ponting',50000);
INSERT INTO emp VALUES(107,'Clarke',80000);
INSERT INTO emp VALUES(108,'Marsh',60000);
COMMIT;

SELECT salary FROM emp ORDER BY salary DESC;

--Records
--======
90000
80000
70000
60000
50000
40000
30000
20000
10000

SELECT min(salary) FROM (SELECT salary FROM emp ORDER BY salary DESC) WHERE ROWNUM<3;

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Oracle General Interview Questions

Hi can anyone tell me where are the dumps found of OCA certification.. Also the materials to be studied for the preparation.

2 Answers  


what are pseudocolumns?

4 Answers  


What is trigger associated with the timer ?

1 Answers   Oracle,


Can we use oracle pl/sql block in core java? if so how? pls get back to me .....

0 Answers   TCS,


What is primefaces used for?

0 Answers  






what is null value?

9 Answers  


what is difference between cartesian join & cross join even they give same result?

4 Answers   Bank Of America,


Her departmandaki isçilerden empno' su ikinci sirada olan isçilerin empno, deptno, hiredate, sira_no bigilerini döndüren sorguyu yaziniz?

0 Answers  


3. Adapt your query in (2) above so that only post codes with more than twenty orders are displayed.

0 Answers   Wipro,


Is there an oracle sql query that aggregates multiple rows into one row?

0 Answers  


What is Private Database Link ?

1 Answers  


Can cursor variables be stored in PL/SQL tables.If yes how. If not why?

1 Answers  


Categories
  • Oracle General Interview Questions Oracle General (1789)
  • 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)