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

please explain.. DB architecture ...

1553


I have some query regarding Report generation from Oracle Apps "PO module". I have to generate a report where table columns are as below: Vendor_name Invoice No PO Number Item_Quantity Value of Goods Date of Shipping Name_of_the_transport Date_of_receipt_issued. Now my questions is :from which table/column I can get the information of "Name_of_the_transport" column. Thanks in advance.

2879


what is insert all statement in sql

5483


15. Display the item_cost and then truncate it to the nearest hundred, ten, unit, tenth and hundredth.

1697


How to initialize variables with default values?

625






What happens to the indexes if a table is recovered?

568


What is difference between sid and service name in oracle?

510


How to define an oracle sub procedure?

588


Define oracle database

590


does the query needs a hint to access a materialized view?

1458


Is insert autocommit in oracle?

595


How to rename an index in oracle?

612


Assuming today is Monday, how would you use the DBMS_JOB package to schedule the execution of a given procedure owned by SCOTT to start Wednesday at 9AM and to run subsequently every other day at 2AM.

1498


What is a read only transaction in oracle?

587


List out the components of logical database structure of oracle database.

577