mysql innerjoin 使用group_concat 之后 右表的数据为空的记录也能显示出来

SELECT af.sampleid AS sampleid,
af.designid AS designid,
af.roomid AS roomid,
af.picurl AS picurl,
af.planformurl AS planformurl,
af.panoramaid AS planformid,
af.publicprice AS publicprice,
af.privateprice AS privateprice,
af.name AS name,
af.area AS area,
af.created AS created,
af.typeid AS typeid,
af.decostyleids AS decostyleids,
group_concat(srv2.tagid separator ‘,’) AS custom_tagids
FROM talbleA af INNER JOIN talbleB srv2
on af.sampleid = srv2.sampleid
WHERE af.sampleid =136119

mysql innerjoin 使用group_concat 之后 右表的数据为空的记录也能显示出来_第1张图片
加group_concat 是有结果的,但是 把这个聚合函数去掉就没有结果 感觉很奇怪

你可能感兴趣的:(工作踩坑血泪史)