select p.product_id,max(i.ImagesPath) ImagesPath from teapp as p,Base_Images as i
where p.Product_id=i.Product_Id group by p.product_id