what eliminate duplicate without using roenum and not

Answers were Sorted based on User's Feedback



what eliminate duplicate without using roenum and not..

Answer / madhav

DELETE FROM emp1 A WHERE ROWID > (SELECT min(rowid)
FROM emp1 B
WHERE A.empno = B.empno);

---conn scott/tiger@orcl
create table emp1 as select*from emp;
14 rows inserted
SQL> select*from emp1;

14 rows selected
-----------
insert into emp1
selectempno,ename,job,mgr,hiredate,sal,comm,deptno from emp;

14 row inserted

select*from emp1;

28 rows slected --(14 duplicates row are there)

you can use starting query duplicates rows deleted

Email:thota.madhav@gmail.com

Is This Answer Correct ?    11 Yes 0 No

what eliminate duplicate without using roenum and not..

Answer / satyajit patel

Mr. Kondla is almost right, but forgotten to use keyword
DISTINCT. It should be like

-> create table T2 as select DISTINT(*) from T1;
-> drop table T1;
-> rename T2 to T1;

Is This Answer Correct ?    3 Yes 1 No

what eliminate duplicate without using roenum and not..

Answer / gourav

we can use distinct keyword for elaminate duplicat rows

select distinct(salary)from emplpyees

Is This Answer Correct ?    1 Yes 0 No

what eliminate duplicate without using roenum and not..

Answer / sathish

Use Group clause and having count < 2

Is This Answer Correct ?    1 Yes 3 No

what eliminate duplicate without using roenum and not..

Answer / amar_kondla

>create table table_name2 as select * from table_name1;

>drop table table_name1;

> rename tabale_name2 to table_name1;

Is This Answer Correct ?    1 Yes 4 No

Post New Answer

More SQL PLSQL Interview Questions

How can we store rows in PL/SQL using array?

0 Answers   MCN Solutions,


Talk about views

10 Answers   Polaris,


what is the correct way of selection statement a. select/from/table_name/orderby/groupby/having b. select/from/table_name/groupby/having/orderby

5 Answers   HCL, JPMorgan Chase,


How to select the Nth maximum salary from Table Emp in Oracle SQL Plus ?

0 Answers   MCN Solutions,


what is indexing, searching and user interface?

1 Answers   HCL,


how to analyze tables with 'mysqlcheck'? : Sql dba

0 Answers  


What do you understand by pl/sql packages?

0 Answers  


What is a bitmap index?

4 Answers   Choice Solutions, Infosys,


How do I view a sql trace file?

0 Answers  


What are the syntax and use of the coalesce function?

0 Answers  


What is db journal file?

0 Answers  


Define the select into statement.

0 Answers  


Categories