Mysql去除重復值列,隻保留一條

Mysql去除重復值列,隻保留一條

 

1
DELETE
2
FROM
3
      software USING (software,(SELECT DISTINCT min(id) AS id, ident FROM software GROUP BY ident HAVING count(1) > 1) AS t2)
4
WHERE
5
      software.ident = t2.ident
6
AND software.id > t2.id;

 

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。