Delete duplicate records in the emp table.
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
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 |
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 |
How would you reference column values before and after you have inserted and deleted triggers?
What is Histogram?
I have a table .in the table 100 recored is there .we have get the single row with out using clause..
Why is stored procedure faster than query?
how to use case expression? : Sql dba
Why use triggers in sql?
How are sql commands classified?
What do you mean by stored procedures? How do we use it?
i declare 4 procedure in package specification but in package body i write only 3 procedure. is it complie??//w
4 Answers Scope International,
What is rowid in sql?
what is mean by forward declaration and where we'll use it.
What is not equal in sql?
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)