I can't tell you why brad, but I can tell you it does. I was under the same assumption you were, then I spent 6 hours copying millions of records so I could run a dupe check on them. Also you have to run the delete multiple times if you have multiple dupes, as the group by is only going to return one of the dupe ids.
#1093 - You can't specify target table 'test' for update in FROM clause
CREATE TABLE IF NOT EXISTS `test` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`val` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=9 ;
INSERT INTO `test` (`id`, `val`) VALUES
(1, 2),
(2, 2),
(3, 4),
(4, 5),
(5, 8),
(6, 2),
(7, 2),
(8, 4);
DELETE FROM test WHERE id IN (SELECT id FROM test GROUP BY val HAVING count(id) > 1);
While that delete statement gives the error above, the following does not and executes as expected.
CREATE TEMPORARY TABLE test_tmp select * from test;
DELETE FROM test WHERE id IN (SELECT id FROM test_tmp GROUP BY val HAVING count(id) > 1);