SELECT a.*, b.cityname,c.areaname,d.img_path FROM {$db_mymps}member a left join {$db_mymps}city b on a.cityid=b.cityid left join {$db_mymps}area c on a.areaid=c.areaid left join (select max(img_path) img_path,userid from {$db_mymps}certification group by userid ) d on a.userid=d.userid $where ORDER BY id DESC";// MAX(img_path) img_path 最新一张图片
A left join B B表有多条记录,max(img_path)取最新一条
A right join B对比B表