Delete duplicate records in the emp table.

Answers were Sorted based on User's Feedback



Delete duplicate records in the emp table...

Answer / 14-07-2007

delete from emp where rowid not in(select min(rowid) from
emp group by empno;

Is This Answer Correct ?    13 Yes 2 No

Delete duplicate records in the emp table...

Answer / smriti

delete from tablename a where a.rowid>(select min(rowid)
from tablename b where a.columnname=b.columnname)

Is This Answer Correct ?    8 Yes 1 No

Delete duplicate records in the emp table...

Answer / srinivas ganamur

Delete from table t1
where t1.rowid>(select from table t2
from table t2
where t1.col_name=t2.col_name);

Srinivas Ganamur
Bangalore

Is This Answer Correct ?    7 Yes 3 No

Delete duplicate records in the emp table...

Answer / ch. nageswar subudhi

For delete the DUPLICATE RECORD from Table by using this
Query:

DELETE FROM EMP E
WHERE E.ROWID <>(SELECT MIN(ROWID) FROM EMP E2 WHERE
E.EMP_NO=E2.EMPNO);

Is This Answer Correct ?    4 Yes 3 No

Delete duplicate records in the emp table...

Answer / amedela chandra sekhar

delete from emp x where rowid>(select min(rowid) from emp
where rmpno=x.empno);

Is This Answer Correct ?    0 Yes 0 No

Delete duplicate records in the emp table...

Answer / valli

delete from emp where rowid in(
select rowid from (
select emp_no, sal,rownum() over (emp_no,sal) as
Rownum from emp order_by emp_no,sal
) where rownum > 2
)

Is This Answer Correct ?    1 Yes 4 No

Post New Answer

More SQL PLSQL Interview Questions

How do I save a stored procedure?

0 Answers  


Explain the advantages and disadvantages of stored procedure?

0 Answers  


What are the two types of exceptions in pl/sql?

0 Answers  


what is the differnce between procedure and function? in both dml operations can work and in procedure through out parameter you can return value ,then what is the differce?

3 Answers   3i Infotech,


What is the use of pl/sql table?

0 Answers  






what is an extent ? : Sql dba

0 Answers  


Can sql function call stored procedure?

0 Answers  


how will u find statistics of a database objects?

2 Answers   iFlex,


Why is a primary key important?

0 Answers  


What is row_number () in sql?

0 Answers  


What is the difference between UNIQUE CONSTRAINT and PRIMARY KEY? 1. There is no difference. 2. A PRIMARY KEY cannot be declared on multiple columns. 3. A UNIQUE CONSTRAINT cannot be declared on multiple columns. 4. A table can have multiple PRIMARY KEYS but only one UNIQUE CONSTRAINT. 5. A table can have multiple UNIQUE CONSTRAINTs but only one PRIMARY KEY.

7 Answers   Satyam,


Define join and name different types of joins?

0 Answers  


Categories