use inner join and sub query

select a.* from table a
inner join
(select accountid, max(recordDate) as latestdate from table
group by accountid) b on a.accountid = b.accountid and
a.recorddate = b.latestdate

請您先登陸,再發跟帖!