SELECT h.house_id, h.user_id, h.region, h.address, h.price, h.pet, h.facility, h.house_image, h.house_rent_staus, IFNULL( t_collect_count, 0 ) AS collect_count FROM house_info AS h LEFTJOIN ( SELECT c.house_id, COUNT( * ) t_collect_count FROM house_collect AS c GROUPBY c.house_id ) t ON h.house_id = t.house_id;