mysql удалить дубликаты
CREATE TEMPORARY TABLE IF NOT EXISTS temp_table(`uid` int(10)) ENGINE=MEMORY; TRUNCATE TABLE temp_table; INSERT INTO `temp_table` (SELECT MIN(uid) as uid FROM `base` GROUP BY `organization`); DELETE FROM `base` WHERE `uid` NOT IN (SELECT `uid` FROM `temp_table`);
ALTER IGNORE TABLE base ADD UNIQUE KEY(organization);