SELECT a.StandardID,a.ProductName_e,b.icount FROM t_standard a left join (select count(id) as iCount,max(StandardID) as StandardID from Tproduct where userid=44436 and msg='3' group by StandardID) b on a.StandardID=b.StandardID where b.icount is not NULL