There was an SQL error: Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'cine107.a.stream_id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by - SELECT a.stream_id, SUM(b.n_count_more) AS sums,c.v_title, c.t_content, c.member_id, c.d_time FROM sns_streams a LEFT JOIN date_counts b ON a.stream_id = b.stream_id LEFT JOIN streams c ON a.stream_id = c.id WHERE a.type = 3 GROUP BY b.stream_id order by a.id desc