我的站内信的数据表大约有如下字段:
eg. 如何取出 receiver_id = 1 的最近 10 个 sender_id?
==============================
表述有误,10 个不同的 sender_id
==============================
已经找到: http://guides.rubyonrails.org/active_record_querying.html
query = Client.select(:name).distinct
# => Returns unique names
query.distinct(false)
# => Returns all names, even if there are duplicates