Select and display only duplicate records in mysql

后端 未结 12 2109
南旧
南旧 2020-12-08 06:56

This question is pretty simple I for some reason cant get the proper result to display only the duplicate records

Table   : Paypal_ipn_orders
id                      


        
12条回答
  •  隐瞒了意图╮
    2020-12-08 07:47

    This works the fastest for me

    SELECT
        primary_key
    FROM
        table_name
    WHERE
        primary_key NOT IN (
            SELECT
                primary_key
            FROM
                table_name
            GROUP BY
                column_name
            HAVING
                COUNT(*) = 1
        );
    

提交回复
热议问题