Tabel pangguna duwe 5 cathetan kanthi duplikat email [email protected]
Langkah 1. Gawe tabel anyar sing strukture padha karo tabel asli:
CREATE TABLE user_copy LIKE users
Langkah 2. Lebokake baris sing beda saka tabel asli menyang tabel anyar:
INSERT INTO user_copy SELECT * FROM users GROUP BY email
Langkah 3. nyelehake tabel asli lan ngganti jeneng tabel langsung menyang asli
DROP TABLE users;
ALTER TABLE user_copy RENAME TO users;
asil