Will_paginate

paginate :per_page => 15, :page => page,
:conditions => [‘title like ?’, “%#{search}%”], :order
=> ‘requirement_id DESC, created_at DESC’

In my table:
requirement_id/created_at
1/5am
1/3am
2/5pm
2/3pm

How can I specify to only return the first row in each requirement_id
group? That is, I only want to paginate 1/3am and 2/3pm because 1/3am is
the first row in the group requirement_id = 1…

Thanks!

Justin To wrote:

paginate :per_page => 15, :page => page,
:conditions => [‘title like ?’, “%#{search}%”], :order
=> ‘requirement_id DESC, created_at DESC’

I’ve been reading around and I think a solution may be to use the SQL
‘limit 1’, but where do I stick this in?