基于group的mysql查询只返回一行

时间:2017-03-14 14:51:13

标签: mysql sql

有两张桌子。收到的第一张表与group by。第二次收到了分组。 enter image description here

当我使用group时,我只得到第一行。也许以某种方式存在我如何通过字段sector_name获取所有行:

select engine4_image_uploads.sector_id, engine4_image_gyms.gym, engine4_storage_sectors.sector_name, engine4_image_uploads.route_author, engine4_image_uploads.route_name, engine4_image_uploads.difficulty_grade 
from engine4_storage_sectors 
inner join engine4_image_gyms on engine4_storage_sectors.gym_name = engine4_image_gyms.gym inner 
join engine4_image_uploads on engine4_image_uploads.sector_id = engine4_storage_sectors.sector_id 
where engine4_image_gyms.gym = 'test4' 
group by sector_name

0 个答案:

没有答案