Detect with Left Join duplicates entries and return the first value, also return sum of duplicates entries
SELECT DISTINCT
       CASE WHEN t2.ID IS NULL 
            THEN t1.Name
            ELSE t2.Name
            END Name,
       CASE WHEN t2.ID IS NULL 
            THEN t1.ID
            ELSE t2.ID
            END ID,
       CASE WHEN t2.ID IS NULL 
            THEN t1.Account
            ELSE t2.Account
            END Account,
       CASE WHEN t2.ID IS NULL 
            THEN 'No'
            ELSE 'Yes'
            END Column_A,
       ( SELECT COUNT(t4.Account)
         FROM BankAccounts t4
         WHERE t1.Account = t4.Account ) NumberOfMatches,
       CASE WHEN t2.ID IS NULL 
            THEN CONCAT(t1.Name, ' (OK)')
            ELSE CONCAT(t1.Name, ' (BAD)')
            END Column_B,
       CASE WHEN t2.ID IS NULL 
            THEN NULL
            ELSE t1.ID
            END BadID
FROM BankAccounts t1
LEFT JOIN BankAccounts t2 ON t1.Account = t2.Account
                         AND t1.ID &lt; t2.ID
LEFT JOIN BankAccounts t3 ON t1.Account = t3.Account
                         AND t1.ID &gt; t3.ID
WHERE t3.ID IS NULL
ORDER BY Account, ID;


fiddle