Home » SQL & PL/SQL » SQL & PL/SQL » getting duplicate records
getting duplicate records [message #19591] Sun, 31 March 2002 01:58 Go to next message
susheel
Messages: 1
Registered: March 2002
Junior Member
i have to get records from 2 tables where there is a repating data in the one colum for eg i need a records from the table where there is same empid in the table.
Re: getting duplicate records [message #19600 is a reply to message #19591] Mon, 01 April 2002 03:15 Go to previous messageGo to next message
Skumar
Messages: 17
Registered: April 2002
Junior Member
Select a.empid from emp a,emp b where
a.empid = b.empid and a.rowid > b.rowid

this query will give all the values of empid which a duplicate.
Re: getting duplicate records [message #20365 is a reply to message #19591] Fri, 17 May 2002 03:21 Go to previous message
Nasir
Messages: 8
Registered: February 2002
Junior Member
To check for multi-column (key) duplicates:
===========================================
select rowid, deptno, dname
from dept outer
where
outer.rowid > (select min(rowid) from dept inner
where inner.deptno||inner.dname=outer.deptno||outer.deptno)
order by deptno;
Previous Topic: size limit to pass as parameter
Next Topic: Re: list of tables
Goto Forum:
  


Current Time: Thu May 09 18:25:09 CDT 2024