How to Remove the 3rd highest salary person record from
table?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
How do you find current date and time in oracle?
diff between DELETE and TRUNCATE?.
14 Answers HCL, Yalamanchili Software,
Hi Masters, in Oracle Applications 11i, we hace 2 functions using the same form, i need to create 1 personalization, but that code must afect only one function.... how can i do that?
hi friends i completed b.com 2004.i have 3y accounting exp. in manufacturing company.now i have completed oracle finance.pls suggest me how will get job in oracle.can i get job in oracle.
Explain the use of tables option in exp command.
select to_char('10','10') from dual This gives me an error oRA-1481 INVALID NUMBER FORMAT MODEL why? pls help
What is the difference between SQL, DDL, and DML?
7 Answers BeBo Technologies, Wipro,
Provide an example of a shell script which logs into SQLPLUS as SYS, determines the current date, changes the date format to include minutes & seconds, issues a drop table command, displays the date again, and finally exits.
List the various oracle database objects?
What does `(+)` do in a where clause?
How to write date and time interval literals in oracle?
How a database is related to tablespaces?