Last active
December 23, 2015 12:59
-
-
Save frentsel/6639573 to your computer and use it in GitHub Desktop.
Для этого создаем временную таблицу и переносим по одной все не дублируемые записи.Дальше можно переименовать таблицы или перенести все записи из таблицы tmp_users
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 1. Создаем временную таблицу с правильными записями | |
CREATE TABLE tmp_users | |
SELECT * FROM users AS u | |
GROUP BY u.login | |
HAVING COUNT(u.login) >= 1 | |
-- 2. Переносим данные из tmp_users в users | |
-- предварительно очистив users | |
INSERT INTO users | |
SELECT * FROM tmp_users |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment