select b.* from a left join b on a.id=b.id and b.xxx = 'xxx'