比如SELECT t2.group_id,count(*) as gnm from A t1 LEFT JOIN B t2 on t1.id=t2.id LEFT JOIN C t3 on t2.id=t3.idGROUP BY t2.group_id。执行逻辑就是先查询,再GROUP BY主要你要搞清楚group by 后多个参数的含义。
比如
SELECT t2.group_id,count(*) as gnm from A t1 LEFT JOIN B t2 on t1.id=t2.id LEFT JOIN C t3 on t2.id=t3.id
GROUP BY t2.group_id。
执行逻辑就是先查询,再GROUP BY
主要你要搞清楚group by 后多个参数的含义。