08-6-16 MySQL 刪除重複項目

delete users_groups as a from users_groups as a,
(
select *,min(id) from users_groups group by uid having count(1) > 1
) as b
where a.uid = b.uid and a.id > b.id;

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *