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 privilege is needed for a user to delete rows from tables in another schema?

0 Answers  


How to use "while" statements in oracle?

0 Answers  


interview questions with answer for cts

0 Answers   Cognizant,


9. Display the client name and order date for all orders using the JOIN . . . USING method.

2 Answers   Wipro,


when do u go for hash partitioning?

1 Answers  






What is not equal to in oracle?

0 Answers  


What is the difference between normal and corelated subqueries?

2 Answers  


What happens if variable names collide with table/column names?

0 Answers  


How to write a left outer join with the where clause in oracle?

0 Answers  


How to select some columns from a table in oracle?

0 Answers  


What are the differences between blob and clob in oracle?

0 Answers  


How can we Update a table with out using UPDATE command?

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)