tag:blogger.com,1999:blog-2176131268461708372.post89677426211327683..comments2023-05-30T06:34:37.520-07:00Comments on Java Updates: Remove Duplicate Rows from a Table in MySQLHimanshuhttp://www.blogger.com/profile/00048794804378272523noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-2176131268461708372.post-59426279767501834662013-07-19T00:46:02.227-07:002013-07-19T00:46:02.227-07:00Good one, thanks Himanshu,KethanGood one, thanks Himanshu,KethanSuraj Chauhanhttps://www.blogger.com/profile/13775258656060926416noreply@blogger.comtag:blogger.com,1999:blog-2176131268461708372.post-29640334560632472962013-05-13T04:38:05.358-07:002013-05-13T04:38:05.358-07:00Thanks for sharing the error scenario, I have upda...Thanks for sharing the error scenario, I have updated the blog accordingly.Himanshuhttps://www.blogger.com/profile/00048794804378272523noreply@blogger.comtag:blogger.com,1999:blog-2176131268461708372.post-70865950993782389042013-05-13T04:30:50.523-07:002013-05-13T04:30:50.523-07:00Thanks for this tutorial :)Thanks for this tutorial :)Kethanhttps://www.blogger.com/profile/13685054988460372274noreply@blogger.comtag:blogger.com,1999:blog-2176131268461708372.post-82387099053208783472013-05-13T04:29:23.605-07:002013-05-13T04:29:23.605-07:00Yes, this is a bug with MySQL. Glad you got the an...Yes, this is a bug with MySQL. Glad you got the answer.Himanshuhttps://www.blogger.com/profile/00048794804378272523noreply@blogger.comtag:blogger.com,1999:blog-2176131268461708372.post-17458359870929650822013-05-13T04:26:44.478-07:002013-05-13T04:26:44.478-07:00Nope I found the answer after some googling :)
T...Nope I found the answer after some googling :) <br /><br />This was due to a bug in Innodb for some versions of mysql. The workaround is to convert the engine and then back to original.<br /><br />ALTER TABLE t1 ENGINE MyISAM;<br />ALTER IGNORE TABLE t1 ADD UNIQUE INDEX dupidx (field);<br />ALTER TABLE t1 ENGINE InnoDB;Kethanhttps://www.blogger.com/profile/13685054988460372274noreply@blogger.comtag:blogger.com,1999:blog-2176131268461708372.post-55864474856717194822013-05-13T04:24:06.883-07:002013-05-13T04:24:06.883-07:00Hi Kethan,
I think you are missing the delimiter h...Hi Kethan,<br />I think you are missing the delimiter here.<br /><br />Try:<br />select * from t1;<br /><br />And for altering use: (If you are following the sample)<br />ALTER IGNORE TABLE t1 ADD UNIQUE INDEX dup_idx (year_col, firstname);Himanshuhttps://www.blogger.com/profile/00048794804378272523noreply@blogger.comtag:blogger.com,1999:blog-2176131268461708372.post-14438126461830534112013-05-13T04:23:33.628-07:002013-05-13T04:23:33.628-07:00This comment has been removed by the author.Himanshuhttps://www.blogger.com/profile/00048794804378272523noreply@blogger.comtag:blogger.com,1999:blog-2176131268461708372.post-4637882883372811782013-05-13T04:20:00.123-07:002013-05-13T04:20:00.123-07:00I am getting the following error
0 16:48:58 selec...I am getting the following error<br /><br />0 16:48:58 select * from t1 ALTER Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ALTER' at line 3<br />Kethanhttps://www.blogger.com/profile/13685054988460372274noreply@blogger.comtag:blogger.com,1999:blog-2176131268461708372.post-27020309453793650402013-05-10T04:17:19.892-07:002013-05-10T04:17:19.892-07:00Good one.Good one.Natraj Aggashttps://www.blogger.com/profile/14826307144317345209noreply@blogger.com