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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is format trigger?

1625


What are the roles of dba?

617


How to use an explicit cursor without open statements?

618


Is a rollback possible to any savepoint?

565


Why does for update in oracle 8 cause an ora-01002 error?

556






What to do if the binary spfile is wrong for the default instance?

571


Tab A A B ------ 1 A 2 B 3 C Tab B A B ----- 4 D 5 E 6 F Generate the value into B table from A table. Only table A has the value. Write the SQL query to get B table value.

1268


WHAT IS ecc 6.0

1670


Explain oracle insert into command?

637


How oracle handles dead locks?

608


Give syntax for SQL and ORACLE joins.

640


What are the numeric comparison operations?

637


How to count duplicated values in a column in oracle?

558


How to rename an index in oracle?

626


How to drop a stored function?

682