What is the best way to find records with duplicate values across multiple columns using Postgres, and Activerecord?
I found this solution here:
User.f
That error occurs because POSTGRES requires you to put grouping columns in the SELECT clause.
try:
User.select(:first,:email).group(:first,:email).having("count(*) > 1").all
(note: not tested, you may need to tweak it)
EDITED to remove id column