select a.*,b.id,b.tax,b.paydate from b b1,a
where paydate=(select max(paydate) from b where personid=b1.personid)
and a.personid=b1.personid