CodeIgniter / PHPFinding Duplicates with SQL December 1, 2017 Chandan SharmaComment on Finding Duplicates with SQL#Finding Duplicates with SQL:: SELECT `email`, COUNT(`email`) AS NumOccurrences FROM `user` GROUP BY `email` HAVING ( COUNT(`email`) > 1 ) For Single Occurance Use:: SELECT email FROM users GROUP BY email HAVING ( COUNT(email) = 1 )Share this:FacebookX