You should be able to do it with the select you already have,
something like this:
delete ACCOUNTACTION from ACCOUNTACTION join (
select ACCOUNTACTION.ID from ACCOUNTACTION
where ACCOUNTACTION.ACTIONDATE like '2008-08-01 02:00%'
group by ACCOUNTACTION.ACCOUNT_ID
having
);
Thanks for the pointers ;-)
-Original Message-
From: Magnus Smith [mailto:[EMAIL PROTECTED]
Sent: 07 August 2008 10:35
To: Ananda Kumar
Cc: mysql@lists.mysql.com
Subject: RE: removing duplicate entries
Yes I can see you are correct. I tried setting up a little test case
myself
- thanks
From: Ananda Kumar [mailto:[EMAIL PROTECTED]
Sent: 06 August 2008 13:51
To: Magnus Smith
Cc: mysql@lists.mysql.com
Subject: Re: removing duplicate entries
I just did a test case here
select * from amc_25;
+--+
| id |
+--+
|2
On Thu, Aug 7, 2008 at 2:34 AM, Magnus Smith
[EMAIL PROTECTED] wrote:
Yes I can see you are correct. I tried setting up a little test case
myself.
CREATE TABLE ACCOUNTACTION (
ID INT NOT NULL PRIMARY KEY,
ACTIONDATE DATETIME,
ACCOUNT_ID INT NOT NULL
);
Subject: RE: removing duplicate entries
Yes I can see you are correct. I tried setting up a little test case
myself.
CREATE TABLE ACCOUNTACTION (
ID INT NOT NULL PRIMARY KEY,
ACTIONDATE DATETIME,
ACCOUNT_ID INT NOT NULL
);
CREATE TABLE ACCOUNTPAYMENTACTION
I have the following two tables
ACCOUNTACTION
+---+--+--+-+-+---+
| Field | Type | Null | Key | Default | Extra |
+---+--+--+-+-+---+
| ID| bigint(20) | NO |
I doubt the belwo sql will give you duplcates
select ACCOUNTACTION.ID http://accountaction.id/ from ACCOUNTACTION
where ACCOUNTACTION.ACTIONDATE like '2008-08-01 02:00%'
group by ACCOUNTACTION.ACCOUNT_ID
having (count(ACCOUNTACTION.ACCOUNT_ID) 1 and
ACCOUNTACTION.IDhttp://accountaction.id/!=
Smith
Cc: mysql@lists.mysql.com
Subject: Re: removing duplicate entries
I doubt the belwo sql will give you duplcates
select ACCOUNTACTION.ID http://accountaction.id/ from ACCOUNTACTION
where ACCOUNTACTION.ACTIONDATE like '2008-08-01 02:00%'
group by ACCOUNTACTION.ACCOUNT_ID
having (count
: removing duplicate entries
I doubt the belwo sql will give you duplcates
select ACCOUNTACTION.ID http://accountaction.id/ from ACCOUNTACTION
where ACCOUNTACTION.ACTIONDATE like '2008-08-01 02:00%'
group by ACCOUNTACTION.ACCOUNT_ID
having (count(ACCOUNTACTION.ACCOUNT_ID) 1
Hello,
I was wondering how would it be possible to delete those records from
database which has just same data? There can be also up to ten copies of the
record in database, and all but one should be deleted. Do you have any easy
way to do this?
Thank you,
Ville Mattila
duplicate entries
Hello,
I was wondering how would it be possible to delete those records from
database which has just same data? There can be also up to ten copies of the
record in database, and all but one should be deleted. Do you have any easy
way to do this?
Thank you,
Ville Mattila
* Ville Mattila
I was wondering how would it be possible to delete those records from
database which has just same data? There can be also up to ten
copies of the record in database, and all but one should be deleted.
Do you have any easy way to do this?
You could do it by creating a new
I hope that someone here can help me with a little problem. We have a
database that has a lot of duplicate entries in it for one of the fields
(email). I need to find a way to search the database, find all of the
duplicate entries and delete all but one of the entries. It would not be
13 matches
Mail list logo