Subject Re: [firebird-support] select multiple max
Author Dimitry Sibiryakov
05.03.2010 11:40, korkless wrote:
> where ID is the id of the row witht row.SOURCE_ID = SOURCE_ID
> and wich have the last timestamp.
>
> what's the best way to do that? thanks

select r.id, r.source_id from results r join
(select source_id, max(date) mdate from results group by source_id) r1
on r.date=r1.mdate and r.source_id=r1.source_id

--
SY, SD.