Jaimal Chohan
Jaimal Chohan

Reputation: 8645

Converting SQL to ActiveRecord

I need help converting this bit of T-SQL into an ActiveRecord Query

select entry
from faxlog
group by entry
having count(entry) >= 8

Upvotes: 0

Views: 104

Answers (1)

tdgs
tdgs

Reputation: 1096

Try this:

Faxlog.group(:entry).select("entry").having("count(entry) >= ?", 8)

Upvotes: 1

Related Questions