table1 table2
id name logo id name value
1 a asd 1 a 2
2 b asd 2 a 3
3 c asd 3 b 4
询问:
SELECT table1.id,table1.logo,avg(table2.value) as average,
count(table2.id) as no FROM table1 INNER JOIN table2 ON table1.name = table2.name
ORDER BY no
此代码仅给出一个结果而不是 2 个结果