If table has no PK, and no Unique key
How else can I found out if table has duplicated rows.
Example
Table = table1
with
col1 = Varchar
col2 = Number
col3 = Date
col4 = Varchar
Thanks in Advance
Printable View
If table has no PK, and no Unique key
How else can I found out if table has duplicated rows.
Example
Table = table1
with
col1 = Varchar
col2 = Number
col3 = Date
col4 = Varchar
Thanks in Advance
based on column value using group by clause
select lastname,firstname
from employee
group by lastname,firstname
having count(*) > 1;
u can also get duplicate rows by using max(rowid)
sumi_ocp What do you mean and how ?
His mean u can get distinct rows by using rowid as follows.
select * from emp where rowid in (
select max(rowid) from emp group by empno)
Like this u can get distinct rows or u can deleted duplicate rows by keeping one row.
Cheers,
Ganesh.G.
Hi
Here is sql which will display how many duplicate records are there for the table TABLE1
Select col1, col2, col3, col4,count(*) NO_OF_DUPLICATES
from table1
group by col1,col2,col3,col4
having count(*) > 1;
Regards