How to Remove the 3rd highest salary person record from
table?

Answers were Sorted based on User's Feedback



How to Remove the 3rd highest salary person record from table?..

Answer / suresh babu

delete from employees where employee_id in (select
employee_id from employees where 3 =(select count(distinct
e.salary) from employees e
where e.salary >= employees.salary));

Is This Answer Correct ?    17 Yes 1 No

How to Remove the 3rd highest salary person record from table?..

Answer / khan

DELETE FROM
(SELECT EMP_ID, SALARY, DENSE_RANK() OVER (ORDER BY SALARY DESC) AS CNT FROM EMPLOYEE)
WHERE CNT = 3;

Is This Answer Correct ?    9 Yes 5 No

How to Remove the 3rd highest salary person record from table?..

Answer / prasanna

DELETE FROM
(SELECT EMP_ID, SALARY, DENSE_RANK() OVER (ORDER BY SALARY
DESC) AS CNT FROM EMPLOYEE)
WHERE CNT = 3;

or

delete from employees where employee_id in (select
employee_id from employees where 2 =(select count(distinct
e.salary) from employees e
where e.salary > employees.salary));

Is This Answer Correct ?    3 Yes 3 No

How to Remove the 3rd highest salary person record from table?..

Answer / avnish srivastava-test engg fc

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

Is This Answer Correct ?    10 Yes 11 No

How to Remove the 3rd highest salary person record from table?..

Answer / jainish

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

Is This Answer Correct ?    4 Yes 5 No

How to Remove the 3rd highest salary person record from table?..

Answer / krishna

delete from emp where sal >(select max(sal) from emp where
sal >(select max(sal) from emp where sal >(select max(sal)
from emp)));

Is This Answer Correct ?    0 Yes 2 No

How to Remove the 3rd highest salary person record from table?..

Answer / manoj

delete from employee where sal = (select sal from (select sal from employee order by sal desc) where rownum = 3);

Is This Answer Correct ?    1 Yes 3 No

How to Remove the 3rd highest salary person record from table?..

Answer / nathan

DELETE FROM emp
WHERE empno = (SELECT empno
FROM (SELECT empno, ROWNUM rn
FROM (SELECT empno
FROM emp
ORDER BY sal DESC))
WHERE rn = 3);

Is This Answer Correct ?    1 Yes 3 No

How to Remove the 3rd highest salary person record from table?..

Answer / basanti

delete from employee where salary(select salary from(select
distinct (salary) from employee where salary is NOT NULL
order by salary desc) where rownum=n);

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More Oracle General Interview Questions

What is meant by a deadlock situation?

0 Answers  


i can create a view with two columns from emp table,, later i need to add one more emp column to existing view.. what is query similarly add one more column to existing primary key constraint.. please give me the solutions

4 Answers   CGI,


What is an anonymous block?

0 Answers  


What is the difference between truncate & delete command?

0 Answers  


Explain the relationship among Database, Tablespace and Data file?

4 Answers  






How to use "while" statements in oracle?

0 Answers  


what is the difference between rollback & commit? can a foreign key has null value?

6 Answers  


How to get the Installed Oracle Version Information ?

0 Answers   MCN Solutions,


Explain constraining triggers.

0 Answers  


What query tells you how much space a tablespace named test is taking up, and how much space is remaining?

0 Answers   Infosys,


Explain the use of parfile option in exp command.

0 Answers  


What is an oracle table?

0 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)