uot;Tim Bunce" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, September 22, 2003 6:36 PM
Subject: Re: SQL statement to find and delete double entries
Thanks, Tim. Adding Oracle to your search yielded the following quickly.
delete from T t1
where t1.rowid >
EMAIL PROTECTED]
"Christian Merz" <[EMAIL PROTECTED]>
09/23/2003 09:49 AM
To: Jeffrey Seger/Corporate/[EMAIL PROTECTED]
cc: <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
Subject: Re: SQL statement
r data model
...
cu, Christian
- Original Message -
From: <[EMAIL PROTECTED]>
To: "Tim Bunce" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, September 22, 2003 6:36 PM
Subject: Re: SQL statement to find and delete double entries
> Thanks, Tim. Addin
ED],
"Morrison, Trevor (Trevor)" <[EMAIL PROTECTED]>
Subject: Re: SQL statement to find and delete double entries
It's a common problem. You can start here:
http://www.google.com/search?as_q=sql+delete+duplicate
and add the name of the databa
Avis,
The use of a unique clustered index is an interesting solution, however,
it requires 1.2 times the space currently consumed by the table and
rewrites the table. IMHO, unless we are talking a major duplication
i.e. 90% dupes, creating the clustered index will be slower.
Chuck
[EMAIL PR
If you are using Sybase, you can delete duplicate rows from a table
by creating a unique clustered index 'with ignore_dup_row' (and then
dropping it again if you don't want to ignore later duplicate
inserts). I haven't benchmarked but I think this will be somewhat
faster than a stored procedure.
Cc: Christian Merz; [EMAIL PROTECTED]; Morrison, Trevor (Trevor)
Subject: Re: SQL statement to find and delete double entries
Jeff,
Here is the syntax for doing this in Sybase as a stored procedure.
Assumption: id is an int.
CREATE PROCEDURE del_dupes
AS
BEGIN
DECLARE @id int, @id_count int
PROTECTED]>
09/18/2003 08:33 AM
To: "Morrison, Trevor (Trevor)" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
cc:
Subject:Re: SQL statement to find and delete double entries
Hi,
the basic idea to find duplicate or multiple values is:
select id, count
33 AM
>
>
> To: "Morrison, Trevor (Trevor)" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
> cc:
> Subject:Re: SQL statement to find and delete double entries
>
>
> Hi,
>
> the basic idea to find duplicate or multiple
revor)" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
cc:
Subject:Re: SQL statement to find and delete double entries
Hi,
the basic idea to find duplicate or multiple values is:
select id, count(*)
from table
group by id
having count(*) > 1;
Hi,
the basic idea to find duplicate or multiple values is:
select id, count(*)
from table
group by id
having count(*) > 1;
to delete ALL such values you may do this:
delete from table where id in
( select id
from table
group by id
having count(*)
--- "Morrison, Trevor (Trevor)" <[EMAIL PROTECTED]> wrote:
> What would be an SQL statement that will find duplicate order numbers in
> table and then delete them?
Try a google statement, like "sql delete duplicate rows"
__
Do you Yahoo!?
Yahoo! SiteBuilder - Fre
12 matches
Mail list logo