select * from a,(select * from b 
where 日期 in(select max(日期) from b group by 帐号) t
where a.帐号=b.帐号;