Re: Delete duplicate entry

2004-10-11 Thread Batara Kesuma
Hi Gerald, > try ALTER IGNORE TABLE. Thank you very much. I should have checked the manual first. http://dev.mysql.com/doc/mysql/en/ALTER_TABLE.html IGNORE is a MySQL extension to standard SQL. It controls how ALTER TABLE works if there are duplicates on unique keys in the new table. If IGNORE i

Re: Delete duplicate entry

2004-10-08 Thread gerald_clark
Daniel Kasak wrote: gerald_clark wrote: Batara Kesuma wrote: Hi, I have a table that looks like: CREATE TABLE `message_inbox` ( `member_id` mediumint(8) unsigned NOT NULL default '0', `message_id` int(10) unsigned NOT NULL default '0', `new` enum('y','n','replied') NOT NULL default 'y', `datet

Re: Delete duplicate entry

2004-10-07 Thread Daniel Kasak
Eldo Skaria wrote: Hi, I think the query has to be considering the count rather than the sum. the query can be like this: select pkfield1[,pkfield2[,pkfield3[,]]], count(1) from group by pkfield1[,pkfield2[,pkfield3[,]]] having count(1) > 1 Here u can add n-number of feilds which u want ma

Re: Delete duplicate entry

2004-10-07 Thread Eldo Skaria
Hi, I think the query has to be considering the count rather than the sum. the query can be like this: select pkfield1[,pkfield2[,pkfield3[,]]], count(1) from group by pkfield1[,pkfield2[,pkfield3[,]]] having count(1) > 1 Here u can add n-number of feilds which u want make PK. Reg, El

Re: Delete duplicate entry

2004-10-07 Thread Daniel Kasak
gerald_clark wrote: Batara Kesuma wrote: Hi, I have a table that looks like: CREATE TABLE `message_inbox` ( `member_id` mediumint(8) unsigned NOT NULL default '0', `message_id` int(10) unsigned NOT NULL default '0', `new` enum('y','n','replied') NOT NULL default 'y', `datetime` datetime default

Re: Delete duplicate entry

2004-10-07 Thread gerald_clark
Batara Kesuma wrote: Hi, I have a table that looks like: CREATE TABLE `message_inbox` ( `member_id` mediumint(8) unsigned NOT NULL default '0', `message_id` int(10) unsigned NOT NULL default '0', `new` enum('y','n','replied') NOT NULL default 'y', `datetime` datetime default NULL, KEY `idx_1`

Delete duplicate entry

2004-10-06 Thread Batara Kesuma
Hi, I have a table that looks like: CREATE TABLE `message_inbox` ( `member_id` mediumint(8) unsigned NOT NULL default '0', `message_id` int(10) unsigned NOT NULL default '0', `new` enum('y','n','replied') NOT NULL default 'y', `datetime` datetime default NULL, KEY `idx_1` (`member_id`,`ne