SELECT t1.*, t2.filterid as filterid2FROM(SELECT DISTINCT a.*, f.`filterid` FROM adds a JOIN adds_filters f ON a.`addid` = f.`addid` WHERE a.`catid` = 1 AND a.`manufacturerid` = 1 AND f.`filterid` = 67) t1JOIN (SELECT DISTINCT a.`addid`, f.`filterid` FROM adds a JOIN adds_filters f ON a.`addid` = f.`addid` WHERE a.`catid` = 1 AND a.`manufacturerid` = 1 AND f.`filterid` = 158 ) t2ON t1.addid = t2.addid; 这篇关于从2个表中获取记录数-一对多关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-15 15:24