mercredi 10 février 2016

What is the difference between count and select('DISTINCT COUNT(xxx)') in ActiveRecord?

I have two queries that are similar:

StoreQuery.group(:location).count(:name)

vs

StoreQuery.group(:location).select('DISTINCT COUNT(name)')

I was expecting the results to be exactly the same but they're not. What is the difference between the two?

Aucun commentaire:

Enregistrer un commentaire