you are here: codestackercodes [RSS]finding duplicates entries

finding duplicates entries

having example in rails. from: http://blog.grayproductions.net/articles/five_activerecord_tips

duplicates = User.find( :all,
  :select     => "email, COUNT(email) AS duplicate_count",
  :conditions => "email IS NOT NULL AND email != ''",
  :group      => "email HAVING duplicate_count > 1"
)

Comments