NOT SURE WHAT YOU MEAN THE OLD WAY BUT YOU COULD RUN A SQL TO FIND THE RECORDS YOU WANT HAVING A COUNT GREATER THAN 1. THEN USE THAT QUERY TO GET A DISTINCT RECORD AND PUT THOSE INTO A TEMPORARY TABLE. NEXT DELETE THE DUPLICATE RECORDS AND THEN IMPORT THE CLEAN RECORDS FROM THE TEMP TABLE.
Just off the top of my head, I would try
Select all columns list from (
Select all columns list, count(*) as counting
>From mytable
Group by all columns list) a
Where a.counting 1
I know this would work on oracle... don't know about MSSQL or otherwise, but
you get the idea
GAbriel
You could do something like
select myField, count(myField)
from myTable
group by myField
to get a list of your key item and how many there are.
For just the ones that are duplicates try:
select myField, count(myField)
from myTable
group by myField
having count(myField) 1
Steve
One way to view duplicates is by using a having clause in your query.It
means that there's at least one id/something that will help you know that
the record is a duplicate.An example of this sql is:
select emp_ID, departmentid
from employees
GROUP BY emp_ID, departmentid
having count(emp_ID)=2
: Tuesday, November 04, 2003 2:19 PM
To: CF-Talk
Subject: RE: SQL for duplicate entries
NOT SURE WHAT YOU MEAN THE OLD WAY BUT YOU COULD RUN A SQL TO FIND THE RECORDS YOU WANT HAVING A COUNT GREATER THAN 1. THEN USE THAT QUERY TO GET A DISTINCT RECORD AND PUT THOSE INTO A TEMPORARY TABLE. NEXT DELETE
easy with the caps.
-Original Message-
From: Eric Creese [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 04, 2003 3:19 PM
To: CF-Talk
Subject: RE: SQL for duplicate entries
NOT SURE WHAT YOU MEAN THE OLD WAY BUT YOU COULD RUN A SQL TO FIND THE
RECORDS YOU WANT HAVING A COUNT GREATER
BLAH BLAH BLAH BLAH BLAH
-Original Message-
From: Tangorre, Michael [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 04, 2003 2:48 PM
To: CF-Talk
Subject: RE: SQL for duplicate entries
easy with the caps.
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User
7 matches
Mail list logo