Wednesday, November 2, 2022

Find All Rows Containing Duplicates using SQL CMD

SELECT

    a.*

FROM

    users a

JOIN(

    SELECT

        username,

        email,

        COUNT(*)

    FROM

        users

    GROUP BY

        username,

        email

    HAVING

        COUNT(*) > 1

) b

ON

    a.username = b.username AND a.email = b.email

ORDER BY

    a.email

No comments:

Post a Comment

Office 2021 Activation using command

  @echo off title Activate Microsoft Office 2021 (ALL versions) for FREE - office.com&cls&echo =====================================...