-
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.
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
Santosh
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|