what eliminate duplicate without using roenum and not
Answers were Sorted based on User's Feedback
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 |
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 |
Answer / gourav
we can use distinct keyword for elaminate duplicat rows
select distinct(salary)from emplpyees
| Is This Answer Correct ? | 1 Yes | 0 No |
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 |
Write a query to find the names of users that begin with "um" in sql?
What is rowtype?
what is the difference between clustered and non clustered index in sql? : Sql dba
Write a query to display the current date in sql?
What is sql profiler in oracle?
How can check sql version from command line?
What is the use of count (*) in sql?
I need to write a simple query,which one is better select statement or stored procedure?and why?
Which is faster view or stored procedure?
Does asenumerable execute the query?
what is the difference between sql and t-sql? : Transact sql
what is the functionality of the function htmlentities? : Sql dba
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)