rails 3, active record: any way to tell how many unique values match a "x LIKE ?" query
- by jpwynn
I have a query to find all the phone numbers that match a partial expression such as "ends with 234"
@matchingphones = Calls.find :all,
:conditions => [ "(thephonenumber LIKE ?)", "%234"]
The same phone number might be in the database several times, and so might be returned multiple times by this query if it matches.
What I need is to…