select * from tablename  as a 
where max(logdate)
(select max(logdate) from tablename  as b where a.id=b.id)