Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- DELETE t1 FROM `logs` t1, `logs` t2
- WHERE t1.ip=t2.ip
- AND t1.server=t2.server
- AND t1.login=t2.login
- AND t1.password=t2.password
- AND t1.comment=t2.comment
- AND t1.`id` < t2.`id`
- */
- create table tmp like logs;
- alter table tmp add unique (`server`, `login`, `password`, `comment`);
- insert into tmp select * from logs
- on duplicate key update id = id;
- rename table logs to deleteme, tmp to logs;
- drop table deleteme;
Add Comment
Please, Sign In to add comment