MySql刪除重複數據並保留一條

 

DELETE
FROM
    tbl_1
WHERE
    id NOT IN(
        SELECT
            id
        FROM
            (
                SELECT
                    min(id) AS id
                FROM
tbl_1
GROUP BY `duplicate_id` ) a )
相關文章
相關標籤/搜索